Publish package to PyPi #5
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: Publish package to PyPi | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
build: | |
uses: ./.github/workflows/build-dist.yml | |
publish-to-pypi: | |
name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
needs: [test, build] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/acoustic-tools | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |