Release #18
Workflow file for this run
This file contains 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: Release | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🏷️ | |
uses: actions/checkout@v4 | |
- name: Set up Python 🐍 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies ⚙️ | |
run: | | |
python -m pip install --upgrade pip | |
pip install build twine | |
- name: Build the package 📦 | |
run: python -m build | |
- name: Check the package 🧐 | |
run: python -m twine check dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: release-artifacts | |
path: dist/ | |
pypi-publish: | |
needs: [release] | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
permissions: | |
id-token: write | |
if: github.event_name == 'release' && github.event.action == 'published' | |
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: release-artifacts | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 |