Release #27
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: | |
release: | |
types: [ published ] | |
repository_dispatch: | |
workflow_dispatch: | |
inputs: | |
upload_pypi: | |
description: 'upload to PyPI' | |
type: boolean | |
required: false | |
default: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Install requirements | |
run: pip install build setuptools twine -U | |
- name: Build package | |
run: | | |
python -m build --sdist | |
twine check dist/* | |
- name: Upload sdist to pypi | |
if: (github.event_name == 'release' || github.event.inputs.upload_pypi == 'true') && !cancelled() | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.PYPI_KEY }} | |
run: | | |
python -m twine upload dist/*gz |