Publish release to PyPI #35
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: Publish release to PyPI | |
| on: | |
| release: | |
| types: [created] | |
| permissions: | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set release name as environment variable | |
| run: echo "RELEASE_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install poetry | |
| poetry install --no-root | |
| poetry add build | |
| poetry add wheel | |
| - name: Build a binary wheel and a source tarball | |
| run: | | |
| poetry run python setup.py sdist bdist_wheel | |
| - name: Publish distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |