releasing 1.0.3
#15
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: PyPI Release | |
# https://help.github.com/en/actions/reference/events-that-trigger-workflows | |
on: # Trigger the workflow on push or pull request, but only for the main branch | |
push: | |
branches: [main] | |
release: | |
types: [published] | |
# based on https://github.com/pypa/gh-action-pypi-publish | |
jobs: | |
build-release-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: python -m pip install -U setuptools wheel build twine | |
- name: Build package | |
run: python -m build | |
- name: Check package | |
run: twine check dist/* | |
# We do this, since failures on test.pypi aren't that bad | |
#- name: Publish to Test PyPI | |
# if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | |
# uses: pypa/[email protected] | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.test_pypi_password }} | |
# repository_url: https://test.pypi.org/legacy/ | |
- name: Publish distribution 📦 to PyPI | |
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |