diff --git a/.github/workflows/dynamic_workflow.yaml b/.github/workflows/dynamic_workflow.yaml index fb7112d..df6d9b0 100644 --- a/.github/workflows/dynamic_workflow.yaml +++ b/.github/workflows/dynamic_workflow.yaml @@ -59,7 +59,9 @@ jobs: publish: runs-on: ubuntu-22.04 needs: tests - if: github.ref == 'refs/heads/main' + permissions: + id-token: write + contents: write steps: - uses: actions/checkout@v4 with: @@ -93,7 +95,7 @@ jobs: echo "old version: $old_version" echo "new version: $new_version" echo "new tag: $new_tag" - - name: Release and publish + - name: Release and build if: ${{ env.OLD_VERSION != env.NEW_VERSION }} env: GH_TOKEN: ${{ github.token }} @@ -124,4 +126,5 @@ jobs: poetry version ${{ env.NEW_VERSION }} poetry build - name: Publish + if: ${{ env.OLD_VERSION != env.NEW_VERSION }} uses: pypa/gh-action-pypi-publish@release/v1