v1.0.0 - Gymnasium Migration, new numpy RNG & uv Package Management #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Publish | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: | |
| - created # see https://docs.github.com/en/rest/reference/repos#create-a-release and https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: '>=3.7 <=3.12' | |
| - name: Install Poetry | |
| run: | | |
| curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | |
| python get-poetry.py -y | |
| echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
| - name: Configure poetry | |
| run: poetry config virtualenvs.in-project true | |
| - name: Set up cache | |
| uses: actions/cache@v1 | |
| id: cache | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
| - name: Ensure cache is healthy | |
| if: steps.cache.outputs.cache-hit == 'true' | |
| run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv | |
| - name: Install dependencies | |
| run: poetry install --no-interaction | |
| - name: Publish | |
| env: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| run: | | |
| poetry config pypi-token.pypi $PYPI_TOKEN | |
| poetry publish --build |