--- name: Release on: workflow_dispatch: permissions: contents: read defaults: run: shell: bash -euo pipefail {0} working-directory: . jobs: build-and-release: permissions: contents: write id-token: write uses: dceoy/gh-actions-for-devops/.github/workflows/python-package-release-on-pypi-and-github.yml@main # zizmor: ignore[unpinned-uses] with: package-path: . create-github-release: true publish-to-pypi: false secrets: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-to-pypi: name: Publish the Python 🐍 distribution 📦 to PyPI if: > startsWith(github.ref, 'refs/tags/') needs: - build-and-release runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/${{ needs.build-and-release.outputs.project-name }} permissions: id-token: write # IMPORTANT: mandatory for trusted publishing steps: - name: Download all the dists uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ needs.build-and-release.outputs.distribution-artifact-name }} path: dist/ - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 with: verbose: true