Skip to content

Commit

Permalink
cicd: move out publishing stage from reusable workflow
Browse files Browse the repository at this point in the history
There is bug in publishing github action: pypa/gh-action-pypi-publish#166
that does not allow to publish from reusable workflows.
So we have to move it out.
  • Loading branch information
dkropachev committed Mar 5, 2025
1 parent 279ba24 commit 9247b5e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 20 additions & 1 deletion .github/workflows/publish-manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9247b5e

Please sign in to comment.