Skip to content

Commit 27ef3d5

Browse files
committed
cicd/lib-build-and-push: build pypy and native in single blow
1 parent 0fe7832 commit 27ef3d5

File tree

4 files changed

+26
-29
lines changed

4 files changed

+26
-29
lines changed

.github/workflows/build-pre-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010

1111
target:
1212
type: string
13-
description: "target os to build for: linux,macos,windows"
14-
default: "linux,macos,windows"
13+
description: "target os to build for: linux,macos-x86,macos-arm,windows,linux-aarch64"
14+
default: "linux,macos-x86,macos-arm,windows,linux-aarch64"
1515

1616
jobs:
1717
build-and-publish:

.github/workflows/build-push.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ jobs:
2626
with:
2727
upload: ${{ github.event_name == 'push' && endsWith(github.event.ref, 'scylla') }}
2828
python-version: '3.13'
29-
target: linux,macos,windows

.github/workflows/lib-build-and-push.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
description: "target os to build for: linux,macos,windows"
2020
type: string
2121
required: false
22-
default: "linux,macos,windows"
22+
default: "linux,macos-x86,macos-arm,windows,linux-aarch64"
2323

2424
jobs:
2525
prepare-matrix:
@@ -33,19 +33,27 @@ jobs:
3333
run: |
3434
echo -n "[" > /tmp/matrix.json
3535
was_added=""
36-
for os in $(echo "${{ inputs.target }}" | tr -d " " | tr "," "\n")
36+
for target in $(echo "${{ inputs.target }}" | tr -d " " | tr "," "\n")
3737
do
38-
if [[ "${os}" == "linux" ]]; then
38+
if [[ "${target}" == "linux" ]]; then
3939
[ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
40-
echo -n '{"os":"ubuntu-20.04","platform":"x86_64"},{"os":"ubuntu-20.04","platform":"PyPy"},{"os":"ubuntu-24.04","platform":"aarch64"}' >> /tmp/matrix.json
40+
echo -n '{"os":"ubuntu-20.04", "target": "linux"}' >> /tmp/matrix.json
4141
was_added=1
42-
elif [[ "${os}" == "windows" ]]; then
42+
elif [[ "${target}" == "linux-aarch64" ]]; then
4343
[ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
44-
echo -n '{"os":"windows-2022","platform":"win64"},{"os":"windows-2022","platform":"PyPy"}' >> /tmp/matrix.json
44+
echo -n '{"os":"ubuntu-20.04", "target": "linux-aarch64"}' >> /tmp/matrix.json
4545
was_added=1
46-
elif [[ "${os}" == "macos" ]]; then
46+
elif [[ "${target}" == "windows" ]]; then
4747
[ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
48-
echo -n '{"os":"macos-14","platform":"all"},{"os":"macos-13","platform":"all"},{"os":"macos-14","platform":"PyPy"}' >> /tmp/matrix.json
48+
echo -n '{"os":"windows-2022", "target": "windows"}' >> /tmp/matrix.json
49+
was_added=1
50+
elif [[ "${target}" == "macos-x86" ]]; then
51+
[ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
52+
echo -n '{"os":"macos-13", "target": "macos-x86"}' >> /tmp/matrix.json
53+
was_added=1
54+
elif [[ "${target}" == "macos-arm" ]]; then
55+
[ -n "$was_added" ] && echo -n "," >> /tmp/matrix.json
56+
echo -n '{"os":"macos-14", "target": "macos-arm"}' >> /tmp/matrix.json
4957
was_added=1
5058
fi
5159
done
@@ -54,7 +62,7 @@ jobs:
5462
echo "matrix=$(cat /tmp/matrix.json)" >> $GITHUB_OUTPUT
5563
5664
build-wheels:
57-
name: Build wheels ${{ matrix.os }} (${{ matrix.platform }})
65+
name: Build wheels for ${{ matrix.target }} on ${{ matrix.os }}
5866
runs-on: ${{ matrix.os }}
5967
needs: prepare-matrix
6068
strategy:
@@ -86,7 +94,7 @@ jobs:
8694
choco install openssl --version=3.4.1 -f -y --no-progress
8795
8896
- name: Set up QEMU
89-
if: runner.os == 'Linux' && matrix.platform == 'aarch64'
97+
if: matrix.target == 'linux-aarch64'
9098
uses: docker/setup-qemu-action@v3
9199
with:
92100
platforms: all
@@ -119,28 +127,19 @@ jobs:
119127
echo "Enforcing target deployment for 14.0"
120128
fi
121129
122-
- name: Set build target
123-
shell: bash
124-
run: |
125-
if [[ "${{ matrix.platform }}" == "PyPy" ]]; then
126-
echo "CIBW_BUILD=pp*" >> $GITHUB_ENV;
127-
else
128-
echo "CIBW_BUILD=cp*" >> $GITHUB_ENV;
129-
fi
130-
131130
- name: Build wheels
132-
if: runner.os != 'Linux' || matrix.platform != 'aarch64'
131+
if: matrix.target != 'linux-aarch64'
133132
run: |
134133
python3 -m cibuildwheel --output-dir wheelhouse
135134
136-
- name: Build wheels
137-
if: runner.os == 'Linux' && matrix.platform == 'aarch64'
135+
- name: Build wheels for linux aarch64
136+
if: matrix.target == 'linux-aarch64'
138137
run: |
139-
python -m cibuildwheel --archs aarch64 --output-dir wheelhouse
138+
CIBW_BUILD='cp3*' python -m cibuildwheel --archs aarch64 --output-dir wheelhouse
140139
141140
- uses: actions/upload-artifact@v4
142141
with:
143-
name: wheels-${{ runner.os }}-${{ matrix.platform }}
142+
name: wheels-${{ matrix.target }}-${{ matrix.os }}
144143
path: ./wheelhouse/*.whl
145144

146145
build-sdist:

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ tag_regex = '(?P<version>\d*?\.\d*?\.\d*?)-scylla'
9090
build-frontend = "build[uv]"
9191
environment = { CASS_DRIVER_BUILD_CONCURRENCY = "2", CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST = "yes", CFLAGS = "-g0 -O3" }
9292
skip = ["cp2*", "cp36*", "pp36*", "cp37*", "pp37*", "*i686", "*musllinux*"]
93-
build = ["cp3*"]
93+
build = ["cp3*", "pp3*"]
9494

9595
before-test = "pip install -r {project}/test-requirements.txt"
9696

@@ -109,7 +109,6 @@ test-command = [
109109

110110
[tool.cibuildwheel.macos]
111111
build-frontend = "build"
112-
build = ["cp3*"]
113112
test-command = [
114113
"pytest {project}/tests/unit -k 'not (test_multi_timer_validation or test_empty_connections or test_timer_cancellation)'"
115114
]

0 commit comments

Comments
 (0)