Skip to content

Commit 4a0272b

Browse files
authored
Update release CI (#98)
* update release CI - allows running release CI via manual trigger on non-default branches without uploading artifacts (as a pre-release) to test-pypi. * increase verbosity during build step * switch to build matrix for each arch * expand matrix for each python version * expand matrix for each tagged binary wheel * use regular LTO * switch qemu v8.1.5 adds some rationale in comments too.
1 parent 192d318 commit 4a0272b

File tree

2 files changed

+56
-16
lines changed

2 files changed

+56
-16
lines changed

.github/workflows/release.yml

+56-14
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,99 @@ on:
66
types: [published]
77

88
jobs:
9-
upload-pypi:
10-
permissions:
11-
id-token: write
9+
build:
1210
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
platform: [native, aarch64, armv7l]
15+
python: [cp37, cp38, cp39, cp310, cp311, cp312, cp313]
16+
tag: [manylinux, musllinux]
1317
steps:
14-
- name: Set up Python
15-
uses: actions/setup-python@v5
16-
with:
17-
python-version: 3.x
18-
1918
- name: Checkout Current Repo
2019
uses: actions/checkout@v4
2120
with:
2221
submodules: true
2322
fetch-depth: 0
2423

24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.x
28+
2529
- name: Install dependencies
30+
if: matrix.platform == 'native'
2631
run: |
2732
sudo apt install python3-dev
2833
python3 -m pip install --upgrade pip
2934
python3 -m pip install -r requirements.txt
30-
python3 -m pip install twine
3135
3236
- name: Set up QEMU
37+
if: matrix.platform != 'native'
3338
uses: docker/setup-qemu-action@v3
39+
with:
40+
# cached image is enabled by default.
41+
# This option to disable caching doesn't exist before docker/[email protected]
42+
# cache-image: false
43+
44+
# NOTE: the default tag `tonistiigi/binfmt:latest` is old and uses qemu v6.2.0
45+
# See also https://github.com/tonistiigi/binfmt/issues/215
46+
image: docker.io/tonistiigi/binfmt:qemu-v8.1.5
3447

3548
- name: Build wheels with cibuildwheels
3649
uses: pypa/[email protected]
3750
env:
38-
CIBW_ARCHS_LINUX: aarch64 native armv7l
39-
CIBW_SKIP: cp36* pp* *ppc64le *s390x
51+
CIBW_ARCHS_LINUX: ${{ matrix.platform }}
52+
CIBW_SKIP: pp* *ppc64le *s390x
53+
CIBW_BUILD_VERBOSITY: 1
54+
CIBW_BUILD: '${{ matrix.python }}*${{ matrix.tag }}*'
4055

4156
- name: Move cross-compiled wheels to dist folder
4257
run: |
4358
mkdir -p dist
4459
mv ./wheelhouse/*.whl ${{ github.workspace }}/dist/
4560
4661
- name: build source distributable wheel
47-
# sdist for non-supprted platforms will serve as a stub lib install
62+
# only need to do this once, preferably on a native build.
63+
if: matrix.platform == 'native' && matrix.python == 'cp313' && matrix.tag == 'manylinux'
64+
# sdist for non-supported platforms will serve as a stub lib install
4865
run: |
4966
python -m pip install build
5067
python -m build -s
5168
5269
- name: Save distributable wheels as artifacts
5370
uses: actions/upload-artifact@v4
5471
with:
55-
name: "pyRF24_pkg_dist"
72+
name: pyRF24_pkg_dist_${{ matrix.platform }}_${{ matrix.python }}_${{ matrix.tag }}
5673
path: ${{ github.workspace }}/dist
5774

75+
upload-pypi:
76+
needs: [build]
77+
permissions:
78+
id-token: write
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Checkout Current Repo
82+
uses: actions/checkout@v4
83+
84+
- name: Set up Python
85+
uses: actions/setup-python@v5
86+
with:
87+
python-version: 3.x
88+
89+
- name: Download build artifacts
90+
uses: actions/download-artifact@v4
91+
with:
92+
pattern: pyRF24_pkg_dist_*
93+
path: dist
94+
merge-multiple: true
95+
96+
- name: Display uploaded distributions
97+
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
98+
run: ls -r dist/
99+
58100
- name: Publish package (to TestPyPI)
59-
if: github.event_name == 'workflow_dispatch'
101+
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
60102
uses: pypa/[email protected]
61103
with:
62104
repository-url: https://test.pypi.org/legacy/

CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ if(SKBUILD)
77
message(STATUS "This project is being built using scikit-build & pybind11")
88
endif()
99

10-
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
11-
1210
include(cmake/using_flags.cmake)
1311

1412
add_subdirectory(pybind11)

0 commit comments

Comments
 (0)