From 8a24339455bb58246c78d2670b02465207991a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Magalh=C3=A3es?= Date: Tue, 15 Oct 2024 09:17:20 +0100 Subject: [PATCH] chore: fix semantic-release publish (#129) --- .github/workflows/publish-and-release.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-and-release.yml b/.github/workflows/publish-and-release.yml index b08507bd..a6fda283 100644 --- a/.github/workflows/publish-and-release.yml +++ b/.github/workflows/publish-and-release.yml @@ -3,17 +3,15 @@ name: Semantic Release on: workflow_dispatch: inputs: - publish-pypi: - description: 'Publish to PyPI' - required: false - default: 'true' - type: boolean dry-run: description: 'Dry run' required: false default: 'false' type: boolean +permissions: + id-token: write + jobs: build-and-test: uses: ./.github/workflows/build-and-test.yml @@ -45,11 +43,10 @@ jobs: - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - if: inputs.publish-pypi == 'true' && inputs.dry-run == 'false' + if: ${{ !inputs.dry-run }} - name: Publish package distributions to GitHub Releases - uses: python-semantic-release/upload-to-gh-release@main - if: inputs.dry-run == 'false' with: - github_token: ${{ secrets.PROJECT_AND_REPO_PAT }} - tag: ${{ steps.release.outputs.tag }} + GH_TOKEN: ${{ secrets.PROJECT_AND_REPO_PAT }} + run: | + poetry run semantic-release --strict -vv $([ "${{ inputs.dry-run }}" == "true" ] && echo "--noop") publish --tag ${{ steps.release.outputs.tag }} \ No newline at end of file