Skip to content

Commit d0dd9ee

Browse files
authored
Fix publishing issue (#442)
* cicd: introduce build-test.yml Mantaining file for building and publishing and building for testing is complicated. Let's split them. * cicd: move out publishing stage from reusable workflow 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.
1 parent 2cb73ff commit d0dd9ee

File tree

3 files changed

+64
-15
lines changed

3 files changed

+64
-15
lines changed

Diff for: .github/workflows/build-push.yml

+21-14
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,29 @@ on:
55
branches:
66
- master
77
- 'branch-**'
8-
pull_request:
9-
branches:
10-
- master
11-
paths-ignore:
12-
- docs/*
13-
- examples/*
14-
- .gitignore
15-
- '*.rst'
16-
- '*.ini'
17-
- LICENSE
18-
- .github/dependabot.yml
19-
- .github/pull_request_template.md
8+
workflow_dispatch:
209

2110
jobs:
2211
build-and-publish:
23-
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build')) || github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
12+
name: "Build wheels"
2413
uses: ./.github/workflows/lib-build-and-push.yml
2514
with:
26-
upload: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && endsWith(github.event.ref, 'scylla') }}
15+
upload: false
16+
17+
# 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') }}
18+
publish:
19+
name: "Publish wheels to PyPi"
20+
if: ${{ endsWith(github.event.ref, 'scylla') }}
21+
needs: build-and-publish
22+
runs-on: ubuntu-22.04
23+
permissions:
24+
id-token: write
25+
steps:
26+
- uses: actions/download-artifact@v4
27+
with:
28+
path: dist
29+
merge-multiple: true
30+
31+
- uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
skip-existing: true

Diff for: .github/workflows/build-test.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test wheels building
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- docs/*
9+
- examples/*
10+
- .gitignore
11+
- '*.rst'
12+
- '*.ini'
13+
- LICENSE
14+
- .github/dependabot.yml
15+
- .github/pull_request_template.md
16+
17+
jobs:
18+
test-wheels-build:
19+
name: "Test wheels building"
20+
if: "!contains(github.event.pull_request.labels.*.name, 'disable-test-build')"
21+
uses: ./.github/workflows/lib-build-and-push.yml
22+
with:
23+
upload: false

Diff for: .github/workflows/publish-manually.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,29 @@ on:
3535

3636
jobs:
3737
build-and-publish:
38+
name: "Build wheels"
3839
uses: ./.github/workflows/lib-build-and-push.yml
3940
with:
40-
upload: ${{ inputs.upload }}
41+
upload: false
4142
python-version: ${{ inputs.python-version }}
4243
ignore_tests: ${{ inputs.ignore_tests }}
4344
target_tag: ${{ inputs.target_tag }}
4445
target: ${{ inputs.target }}
46+
47+
# 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 }}
48+
publish:
49+
name: "Publish wheels to PyPi"
50+
needs: build-and-publish
51+
if: inputs.upload
52+
runs-on: ubuntu-22.04
53+
permissions:
54+
id-token: write
55+
steps:
56+
- uses: actions/download-artifact@v4
57+
with:
58+
path: dist
59+
merge-multiple: true
60+
61+
- uses: pypa/gh-action-pypi-publish@release/v1
62+
with:
63+
skip-existing: true

0 commit comments

Comments
 (0)