From e48c7bc24ca716ce38333978e9f3da8806c296ec Mon Sep 17 00:00:00 2001 From: Christopher Chianelli Date: Wed, 15 May 2024 12:00:26 -0400 Subject: [PATCH] ci: Add publish to PyPI step to release workflow (#53) --- .github/workflows/release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7115fa..3e77543 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,11 @@ jobs: env: MAVEN_ARGS: "--no-transfer-progress --batch-mode" runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/timefold-solver + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing steps: - name: Print inputs to the release workflow run: echo "${{ toJSON(github.event.inputs) }}" @@ -119,7 +124,9 @@ jobs: out/jreleaser/trace.log out/jreleaser/output.properties - # TODO: Use https://github.com/marketplace/actions/pypi-publish to publish to PyPI here + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + if: ${{ github.event.inputs.dryRun == 'false' }} # Pull Request will be created with the changes and a summary of next steps. - name: Put back the 999-SNAPSHOT version on the release branch