From 9247b5e1593fa34185db4132af7d6ad59052dd45 Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Wed, 5 Mar 2025 05:20:22 -0400 Subject: [PATCH] cicd: move out publishing stage from reusable workflow There is bug in publishing github action: https://github.com/pypa/gh-action-pypi-publish/issues/166 that does not allow to publish from reusable workflows. So we have to move it out. --- .github/workflows/build-push.yml | 21 ++++++++++++++++++++- .github/workflows/publish-manually.yml | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 9f77b89de..30c49fa2a 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -9,6 +9,25 @@ on: jobs: build-and-publish: + name: "Build wheels" uses: ./.github/workflows/lib-build-and-push.yml with: - upload: ${{ endsWith(github.event.ref, 'scylla') }} + upload: false + + # TODO: Remove when https://github.com/pypa/gh-action-pypi-publish/issues/166 is fixed and update build-and-publish.with.upload to ${{ endsWith(github.event.ref, 'scylla') }} + publish: + name: "Publish wheels to PyPi" + if: ${{ endsWith(github.event.ref, 'scylla') }} + needs: build-and-publish + runs-on: ubuntu-22.04 + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true diff --git a/.github/workflows/publish-manually.yml b/.github/workflows/publish-manually.yml index b022888ef..98327b735 100644 --- a/.github/workflows/publish-manually.yml +++ b/.github/workflows/publish-manually.yml @@ -35,10 +35,29 @@ on: jobs: build-and-publish: + name: "Build wheels" uses: ./.github/workflows/lib-build-and-push.yml with: - upload: ${{ inputs.upload }} + upload: false python-version: ${{ inputs.python-version }} ignore_tests: ${{ inputs.ignore_tests }} target_tag: ${{ inputs.target_tag }} target: ${{ inputs.target }} + + # TODO: Remove when https://github.com/pypa/gh-action-pypi-publish/issues/166 is fixed and update build-and-publish.with.upload to ${{ inputs.upload }} + publish: + name: "Publish wheels to PyPi" + needs: build-and-publish + if: inputs.upload + runs-on: ubuntu-22.04 + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true