From d8351ba777115df9dadc8689d327958918a9e50c Mon Sep 17 00:00:00 2001 From: Claas Date: Sun, 10 Nov 2024 14:16:36 +0100 Subject: [PATCH] .github/workflows/publish_release.yml : Run publishing job from main (non-reusable) workflow. Remove the two reusable workflows _publish_package.yml and _publish_package_test.yml. Background for this change is a limitation recently introduced on pypi, which does not allow anylonger to run the GitHub action 'pypa/gh-action-pypi-publish' from a reusable workflow. The code hence needed to be moved upwards, from the reusable workflow _publish_package.yml into the (non-reusable) workflow publish_release.yml See https://github.com/marketplace/actions/pypi-publish -> Note under "Trusted Publishing" --- .github/workflows/_publish_package.yml | 17 ----------------- .github/workflows/publish_release.yml | 14 +++++++++++++- 2 files changed, 13 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/_publish_package.yml diff --git a/.github/workflows/_publish_package.yml b/.github/workflows/_publish_package.yml deleted file mode 100644 index 0779a17c..00000000 --- a/.github/workflows/_publish_package.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Publish Package to pypi - -on: workflow_call - -jobs: - publish: - name: Publish package - runs-on: ubuntu-latest - environment: release - permissions: - id-token: write - steps: - - uses: actions/download-artifact@v4 - with: - name: artifact - path: dist - - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 9bf6d7c7..faff0983 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -10,9 +10,21 @@ jobs: build_package: uses: ./.github/workflows/_build_package.yml publish_package: + name: Publish package needs: - build_package - uses: ./.github/workflows/_publish_package.yml + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: artifact + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 + # with: # Uncomment this line to publish to testpypi + # repository-url: https://test.pypi.org/legacy/ # Uncomment this line to publish to testpypi merge_into_release: uses: ./.github/workflows/_merge_into_release.yml secrets: