Skip to content

Commit b013176

Browse files
committed
split workflow
1 parent fa78256 commit b013176

File tree

3 files changed

+174
-140
lines changed

3 files changed

+174
-140
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: "Build PyPI Artifacts"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
VERSION:
7+
required: true
8+
type: string
9+
RC:
10+
required: true
11+
type: number
12+
13+
jobs:
14+
pypi-build-artifacts:
15+
name: Build artifacts for PyPi on ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 1
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: |
29+
3.9
30+
3.10
31+
3.11
32+
3.12
33+
34+
- name: Install poetry
35+
run: make install-poetry
36+
37+
- name: Set version with RC
38+
env:
39+
VERSION: ${{ inputs.VERSION }}
40+
RC: ${{ inputs.RC }}
41+
run: python -m poetry version "${{ env.VERSION }}rc${{ env.RC }}" # e.g., 0.8.0rc1
42+
43+
# Publish the source distribution with the version that's in
44+
# the repository, otherwise the tests will fail
45+
- name: Compile source distribution
46+
run: python3 -m poetry build --format=sdist
47+
if: startsWith(matrix.os, 'ubuntu')
48+
49+
- name: Build wheels
50+
uses: pypa/[email protected]
51+
with:
52+
output-dir: wheelhouse
53+
config-file: "pyproject.toml"
54+
env:
55+
# Ignore 32 bit architectures
56+
CIBW_ARCHS: "auto64"
57+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
58+
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
59+
CIBW_TEST_EXTRAS: "s3fs,glue"
60+
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
61+
# There is an upstream issue with installing on MacOSX
62+
# https://github.com/pypa/cibuildwheel/issues/1603
63+
# Ignore tests for pypy since not all dependencies are compiled for it
64+
# and would require a local rust build chain
65+
CIBW_TEST_SKIP: "pp* *macosx*"
66+
67+
- name: Add source distribution
68+
if: startsWith(matrix.os, 'ubuntu')
69+
run: ls -lah dist/* && cp dist/* wheelhouse/
70+
71+
- uses: actions/upload-artifact@v4
72+
with:
73+
name: "pypi-release-candidate-${{ matrix.os }}"
74+
path: ./wheelhouse/*
75+
76+
pypi-merge-artifacts:
77+
runs-on: ubuntu-latest
78+
needs:
79+
- pypi-build-artifacts
80+
steps:
81+
- name: Merge Artifacts
82+
uses: actions/upload-artifact/merge@v4
83+
with:
84+
name: "pypi-release-candidate-${{ inputs.VERSION }}rc${{ inputs.RC }}"
85+
pattern: pypi-release-candidate*
86+
delete-merged: true

.github/workflows/python-release.yml

Lines changed: 8 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -116,152 +116,20 @@ jobs:
116116
117117
# SVN
118118
svn-build-artifacts:
119-
name: Build artifacts for SVN on ${{ matrix.os }}
120-
runs-on: ${{ matrix.os }}
121119
needs:
122120
- validate-inputs
123121
- validate-library-version
124-
strategy:
125-
matrix:
126-
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
127-
128-
steps:
129-
- uses: actions/checkout@v4
130-
with:
131-
fetch-depth: 1
132-
133-
- uses: actions/setup-python@v5
134-
with:
135-
python-version: |
136-
3.9
137-
3.10
138-
3.11
139-
3.12
140-
141-
- name: Install poetry
142-
run: make install-poetry
143-
144-
# Publish the source distribution with the version that's in
145-
# the repository, otherwise the tests will fail
146-
- name: Compile source distribution
147-
run: python3 -m poetry build --format=sdist
148-
if: startsWith(matrix.os, 'ubuntu')
149-
150-
- name: Build wheels
151-
uses: pypa/[email protected]
152-
with:
153-
output-dir: wheelhouse
154-
config-file: "pyproject.toml"
155-
env:
156-
# Ignore 32 bit architectures
157-
CIBW_ARCHS: "auto64"
158-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
159-
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
160-
CIBW_TEST_EXTRAS: "s3fs,glue"
161-
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
162-
# There is an upstream issue with installing on MacOSX
163-
# https://github.com/pypa/cibuildwheel/issues/1603
164-
# Ignore tests for pypy since not all dependencies are compiled for it
165-
# and would require a local rust build chain
166-
CIBW_TEST_SKIP: "pp* *macosx*"
167-
168-
- name: Add source distribution
169-
if: startsWith(matrix.os, 'ubuntu')
170-
run: ls -lah dist/* && cp dist/* wheelhouse/
171-
172-
- uses: actions/upload-artifact@v4
173-
with:
174-
name: "svn-release-candidate-${{ matrix.os }}"
175-
path: ./wheelhouse/*
176-
177-
svn-merge-artifacts:
178-
runs-on: ubuntu-latest
179-
needs:
180-
- validate-inputs
181-
- svn-build-artifacts
182-
steps:
183-
- name: Merge Artifacts
184-
uses: actions/upload-artifact/merge@v4
185-
with:
186-
name: "svn-release-candidate-${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }}"
187-
pattern: svn-release-candidate*
188-
delete-merged: true
122+
uses: ./.github/workflows/svn-build-artifacts.yml
123+
with:
124+
version: ${{ needs.validate-inputs.outputs.VERSION }}
125+
rc: ${{ needs.validate-inputs.outputs.RC }}
189126

190127
# PyPi
191128
pypi-build-artifacts:
192-
name: Build artifacts for PyPi on ${{ matrix.os }}
193-
runs-on: ${{ matrix.os }}
194129
needs:
195130
- validate-inputs
196131
- validate-library-version
197-
strategy:
198-
matrix:
199-
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
200-
201-
steps:
202-
- uses: actions/checkout@v4
203-
with:
204-
fetch-depth: 1
205-
206-
- uses: actions/setup-python@v5
207-
with:
208-
python-version: |
209-
3.9
210-
3.10
211-
3.11
212-
3.12
213-
214-
- name: Install poetry
215-
run: make install-poetry
216-
217-
- name: Set version with RC
218-
env:
219-
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
220-
RC: ${{ needs.validate-inputs.outputs.RC }}
221-
run: python -m poetry version "${{ env.VERSION }}rc${{ env.RC }}" # e.g., 0.8.0rc1
222-
223-
# Publish the source distribution with the version that's in
224-
# the repository, otherwise the tests will fail
225-
- name: Compile source distribution
226-
run: python3 -m poetry build --format=sdist
227-
if: startsWith(matrix.os, 'ubuntu')
228-
229-
- name: Build wheels
230-
uses: pypa/[email protected]
231-
with:
232-
output-dir: wheelhouse
233-
config-file: "pyproject.toml"
234-
env:
235-
# Ignore 32 bit architectures
236-
CIBW_ARCHS: "auto64"
237-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
238-
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
239-
CIBW_TEST_EXTRAS: "s3fs,glue"
240-
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
241-
# There is an upstream issue with installing on MacOSX
242-
# https://github.com/pypa/cibuildwheel/issues/1603
243-
# Ignore tests for pypy since not all dependencies are compiled for it
244-
# and would require a local rust build chain
245-
CIBW_TEST_SKIP: "pp* *macosx*"
246-
247-
- name: Add source distribution
248-
if: startsWith(matrix.os, 'ubuntu')
249-
run: ls -lah dist/* && cp dist/* wheelhouse/
250-
251-
- uses: actions/upload-artifact@v4
252-
with:
253-
name: "pypi-release-candidate-${{ matrix.os }}"
254-
path: ./wheelhouse/*
255-
256-
pypi-merge-artifacts:
257-
runs-on: ubuntu-latest
258-
needs:
259-
- validate-inputs
260-
- pypi-build-artifacts
261-
steps:
262-
- name: Merge Artifacts
263-
uses: actions/upload-artifact/merge@v4
264-
with:
265-
name: "pypi-release-candidate-${{ needs.validate-inputs.outputs.VERSION }}rc${{ needs.validate-inputs.outputs.RC }}"
266-
pattern: pypi-release-candidate*
267-
delete-merged: true
132+
uses: ./.github/workflows/pypi-build-artifacts.yml
133+
with:
134+
version: ${{ needs.validate-inputs.outputs.VERSION }}
135+
rc: ${{ needs.validate-inputs.outputs.RC }}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: "Build SVN Artifacts"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
VERSION:
7+
required: true
8+
type: string
9+
RC:
10+
required: true
11+
type: number
12+
13+
jobs:
14+
svn-build-artifacts:
15+
name: Build artifacts for SVN on ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14, macos-15 ]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 1
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: |
29+
3.9
30+
3.10
31+
3.11
32+
3.12
33+
34+
- name: Install poetry
35+
run: make install-poetry
36+
37+
# Publish the source distribution with the version that's in
38+
# the repository, otherwise the tests will fail
39+
- name: Compile source distribution
40+
run: python3 -m poetry build --format=sdist
41+
if: startsWith(matrix.os, 'ubuntu')
42+
43+
- name: Build wheels
44+
uses: pypa/[email protected]
45+
with:
46+
output-dir: wheelhouse
47+
config-file: "pyproject.toml"
48+
env:
49+
# Ignore 32 bit architectures
50+
CIBW_ARCHS: "auto64"
51+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
52+
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
53+
CIBW_TEST_EXTRAS: "s3fs,glue"
54+
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
55+
# There is an upstream issue with installing on MacOSX
56+
# https://github.com/pypa/cibuildwheel/issues/1603
57+
# Ignore tests for pypy since not all dependencies are compiled for it
58+
# and would require a local rust build chain
59+
CIBW_TEST_SKIP: "pp* *macosx*"
60+
61+
- name: Add source distribution
62+
if: startsWith(matrix.os, 'ubuntu')
63+
run: ls -lah dist/* && cp dist/* wheelhouse/
64+
65+
- uses: actions/upload-artifact@v4
66+
with:
67+
name: "svn-release-candidate-${{ matrix.os }}"
68+
path: ./wheelhouse/*
69+
70+
svn-merge-artifacts:
71+
runs-on: ubuntu-latest
72+
needs:
73+
- svn-build-artifacts
74+
steps:
75+
- name: Merge Artifacts
76+
uses: actions/upload-artifact/merge@v4
77+
with:
78+
name: "svn-release-candidate-${{ inputs.VERSION }}rc${{ inputs.RC }}"
79+
pattern: svn-release-candidate*
80+
delete-merged: true

0 commit comments

Comments
 (0)