diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index b1c7131947..30c49fa2a7 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -5,22 +5,29 @@ on: branches: - master - 'branch-**' - pull_request: - branches: - - master - paths-ignore: - - docs/* - - examples/* - - .gitignore - - '*.rst' - - '*.ini' - - LICENSE - - .github/dependabot.yml - - .github/pull_request_template.md + workflow_dispatch: jobs: build-and-publish: - if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build')) || github.event_name == 'push' && endsWith(github.event.ref, 'scylla')" + name: "Build wheels" uses: ./.github/workflows/lib-build-and-push.yml with: - upload: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && 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/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000000..3e1f1067d7 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,23 @@ +name: Test wheels building + +on: + pull_request: + branches: + - master + paths-ignore: + - docs/* + - examples/* + - .gitignore + - '*.rst' + - '*.ini' + - LICENSE + - .github/dependabot.yml + - .github/pull_request_template.md + +jobs: + test-wheels-build: + name: "Test wheels building" + if: "!contains(github.event.pull_request.labels.*.name, 'disable-test-build')" + uses: ./.github/workflows/lib-build-and-push.yml + with: + upload: false \ No newline at end of file diff --git a/.github/workflows/publish-manually.yml b/.github/workflows/publish-manually.yml index b022888ef0..98327b735d 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