Skip to content

Commit dde4464

Browse files
committed
fix: Fix monorepo CI TestPyPi publish
1 parent 8134248 commit dde4464

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,48 @@ on:
1010

1111
jobs:
1212
full-ci:
13-
uses: ./.github/workflows/ci-base.yml
13+
uses: ./.github/workflows/ci-monorepo.yml
1414
with:
15+
package: async-cassandra
1516
run-integration-tests: true
1617
run-full-suite: true
1718

19+
build-package:
20+
needs: full-ci
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install build dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install build twine
34+
35+
- name: Build package
36+
run: |
37+
cd libs/async-cassandra
38+
python -m build
39+
40+
- name: Check package
41+
run: |
42+
cd libs/async-cassandra
43+
twine check dist/*
44+
45+
- name: Upload build artifacts
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: python-package-distributions
49+
path: libs/async-cassandra/dist/
50+
retention-days: 7
51+
1852
publish-testpypi:
1953
name: Publish to TestPyPI
20-
needs: full-ci
54+
needs: [full-ci, build-package]
2155
runs-on: ubuntu-latest
2256
# Only publish for proper pre-release versions (PEP 440)
2357
if: contains(github.ref_name, 'rc') || contains(github.ref_name, 'a') || contains(github.ref_name, 'b')
@@ -266,11 +300,11 @@ jobs:
266300
267301
publish-pypi:
268302
name: Publish to PyPI
269-
needs: full-ci
303+
needs: [full-ci, build-package]
270304
runs-on: ubuntu-latest
271305
# Only publish stable versions (no pre-release suffix)
272306
# Match only versions like v0.0.1, v1.2.3, etc (no suffix)
273-
if: "!contains(github.ref_name, '-')"
307+
if: "!contains(github.ref_name, 'rc') && !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b') && !contains(github.ref_name, 'dev')"
274308

275309
permissions:
276310
id-token: write # Required for trusted publishing

0 commit comments

Comments
 (0)