Enable publishing to pypi on tag. #2
Workflow file for this run
This file contains hidden or 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 and Release | |
| on: | |
| push: | |
| tags: ["v*"] # Publish on tags matching "v*", eg. "v1.0.0" | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| name: Tests | |
| uses: glenn20/python-ci/.github/workflows/test.yaml@main | |
| with: | |
| os: '["ubuntu-latest", "windows-latest", "macos-latest"]' | |
| python-version: '["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]' | |
| publish-test: | |
| name: Publish to test.pypi | |
| uses: ./.github/workflows/publish.yaml | |
| with: | |
| pypi: test.pypi | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing! | |
| publish-pypi: | |
| name: Publish to pypi | |
| uses: ./.github/workflows/publish.yaml | |
| with: | |
| pypi: pypi | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing! | |
| github-release: | |
| name: Create GitHub release | |
| uses: glenn20/python-ci/.github/workflows/release.yaml@main | |
| needs: publish-test | |
| permissions: | |
| contents: write # IMPORTANT: mandatory for github release | |
| id-token: write # IMPORTANT: mandatory for github release |