| 1 |
# This will run every time a tag is created and pushed to the repository. |
| 2 |
# It calls our tests workflow via a `workflow_call`, and if tests pass |
| 3 |
# then it triggers our upload to PyPI for a new release. |
| 4 |
name: Publish to PyPI |
| 5 |
on: |
| 6 |
release: |
| 7 |
types: ["published"] |
| 8 |
|
| 9 |
jobs: |
| 10 |
tests: |
| 11 |
uses: ./.github/workflows/integration.yml |
| 12 |
publish: |
| 13 |
name: publish |
| 14 |
needs: [tests] # require tests to pass before deploy runs |
| 15 |
runs-on: ubuntu-latest |
| 16 |
steps: |
| 17 |
- name: Checkout source |
| 18 |
uses: actions/checkout@v3 |
| 19 |
- name: Set up Python |
| 20 |
uses: actions/setup-python@v4 |
| 21 |
with: |
| 22 |
python-version: "3.x" |
| 23 |
- name: Build package |
| 24 |
run: | |
| 25 |
pip install build |
| 26 |
git submodule update --init |
| 27 |
python -m build |
| 28 |
- name: Publish |
| 29 |
uses: pypa/[email protected] |
| 30 |
with: |
| 31 |
user: __token__ |
| 32 |
password: ${{ secrets.PYPI_KEY }} |