Skip to content

Commit d9e0575

Browse files
committed
run two builds together
1 parent 1adfcd9 commit d9e0575

File tree

1 file changed

+79
-12
lines changed

1 file changed

+79
-12
lines changed

.github/workflows/python-release.yml

Lines changed: 79 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,64 @@ on:
2929

3030

3131
jobs:
32-
build_wheels:
33-
name: Build wheels on ${{ matrix.os }}
32+
build_svn_artifacts:
33+
name: Build artifacts for SVN on ${{ matrix.os }}
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
matrix:
37+
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
44+
- uses: actions/setup-python@v5
45+
with:
46+
python-version: |
47+
3.9
48+
3.10
49+
3.11
50+
3.12
51+
52+
- name: Install poetry
53+
run: pip install poetry
54+
55+
# Publish the source distribution with the version that's in
56+
# the repository, otherwise the tests will fail
57+
- name: Compile source distribution
58+
run: python3 -m poetry build --format=sdist
59+
if: startsWith(matrix.os, 'ubuntu')
60+
61+
- name: Build wheels
62+
uses: pypa/[email protected]
63+
with:
64+
output-dir: svn_wheelhouse
65+
config-file: "pyproject.toml"
66+
env:
67+
# Ignore 32 bit architectures
68+
CIBW_ARCHS: "auto64"
69+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
70+
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
71+
CIBW_TEST_EXTRAS: "s3fs,glue"
72+
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
73+
# There is an upstream issue with installing on MacOSX
74+
# https://github.com/pypa/cibuildwheel/issues/1603
75+
# Ignore tests for pypy since not all dependencies are compiled for it
76+
# and would require a local rust build chain
77+
CIBW_TEST_SKIP: "pp* *macosx*"
78+
79+
- name: Add source distribution
80+
if: startsWith(matrix.os, 'ubuntu')
81+
run: ls -lah dist/* && cp dist/* svn_wheelhouse/
82+
83+
- uses: actions/upload-artifact@v4
84+
with:
85+
name: "release-svn-${{ matrix.os }}"
86+
path: ./svn_wheelhouse/*
87+
88+
build_pypi_artifacts: # pypi `tag` as version
89+
name: Build artifacts for PyPi on ${{ matrix.os }}
3490
runs-on: ${{ matrix.os }}
3591
strategy:
3692
matrix:
@@ -53,8 +109,7 @@ jobs:
53109
run: pip install poetry
54110

55111
- name: Set version
56-
run: python -m poetry version "${{ inputs.version }}"
57-
if: "${{ github.event.inputs.version != 'main' }}"
112+
run: python -m poetry version "${{ inputs.version }}" # CHANGE TO current TAG
58113

59114
# Publish the source distribution with the version that's in
60115
# the repository, otherwise the tests will fail
@@ -65,7 +120,7 @@ jobs:
65120
- name: Build wheels
66121
uses: pypa/[email protected]
67122
with:
68-
output-dir: wheelhouse
123+
output-dir: pypi_wheelhouse
69124
config-file: "pyproject.toml"
70125
env:
71126
# Ignore 32 bit architectures
@@ -82,19 +137,31 @@ jobs:
82137

83138
- name: Add source distribution
84139
if: startsWith(matrix.os, 'ubuntu')
85-
run: ls -lah dist/* && cp dist/* wheelhouse/
140+
run: ls -lah dist/* && cp dist/* pypi_wheelhouse/
86141

87142
- uses: actions/upload-artifact@v4
88143
with:
89-
name: "release-${{ matrix.os }}"
90-
path: ./wheelhouse/*
91-
merge:
144+
name: "release-pypi-${{ matrix.os }}"
145+
path: ./pypi_wheelhouse/*
146+
147+
merge_svn_artifacts:
148+
runs-on: ubuntu-latest
149+
needs: build_svn_artifacts
150+
steps:
151+
- name: Merge Artifacts
152+
uses: actions/upload-artifact/merge@v4
153+
with:
154+
name: "release-svn-${{ github.event.inputs.version }}"
155+
pattern: release-svn*
156+
delete-merged: true
157+
158+
merge_pypi_artifacts:
92159
runs-on: ubuntu-latest
93-
needs: build_wheels
160+
needs: build_pypi_artifacts
94161
steps:
95162
- name: Merge Artifacts
96163
uses: actions/upload-artifact/merge@v4
97164
with:
98-
name: "release-${{ github.event.inputs.version }}"
99-
pattern: release-*
165+
name: "release-pypi-${{ github.event.inputs.version }}"
166+
pattern: release-pypi*
100167
delete-merged: true

0 commit comments

Comments
 (0)