@@ -2,43 +2,48 @@ name: Build
22
33on :
44 push :
5- tags :
6- # ytf did they invent their own syntax that's almost regex?
7- # ** matches 'zero or more of any character'
8- - ' release-v[0-9]+.[0-9]+.[0-9]+**'
9- - ' prerelease-v[0-9]+.[0-9]+.[0-9]+**'
5+ branches : [main]
6+ pull_request :
7+ branches : ["*"]
8+ workflow_dispatch : # allows you to trigger manually
9+
10+ # When this workflow is queued, automatically cancel any previous running
11+ # or pending jobs from the same branch
12+ concurrency :
13+ group : cidbuildwheel-${{ github.ref }}
14+ cancel-in-progress : true
15+
1016jobs :
1117 build_wheels :
1218 name : Build wheels on ${{ matrix.os }}
1319 runs-on : ${{ matrix.os }}
1420 strategy :
21+ fail-fast : false
1522 matrix :
16- # macos-13 is an intel runner, macos-14 is apple silicon
17- os : [ubuntu-latest, macos-13, macos-14, ubuntu-24.04-arm, windows-latest]
23+ os :
24+ - ubuntu-latest # x64
25+ - ubuntu-24.04-arm # ARM
26+ - macos-15-intel # x64
27+ - macos-latest # ARM
28+ - windows-latest # x64
1829
1930 steps :
2031 # See https://cibuildwheel.pypa.io/en/1.x/cpp_standards/
2132 - uses : ilammy/msvc-dev-cmd@v1
22- - uses : actions/checkout@v4
33+ - uses : actions/checkout@v6
2334
2435 # Install LLVM 18 on Windows
2536 - name : Install LLVM 18 on Windows
2637 if : runner.os == 'Windows'
2738 run : |
2839 choco install llvm --version=18.1.8 -y --force
2940 echo "C:\Program Files\LLVM\bin" >> $env:GITHUB_PATH
30- # This is crazy slow. We'll need to wait for arm Linux
31- # runners.
32- # aarch64 (arm) is built via qemu emulation on Linux
33- # - name: Set up QEMU
34- # if: runner.os == 'Linux'
35- # uses: docker/setup-qemu-action@v3
36- # with:
37- # platforms: all
41+
3842 - name : Debug env
3943 run : env
44+
4045 - name : Build wheels
41- uses : pypa/cibuildwheel@v3.2.1
46+ uses : pypa/cibuildwheel@v3.3.0
4247 env :
4348 CIBW_ARCHS_LINUX : auto
4449 DISTUTILS_USE_SDK : 1
5257 package-dir : .
5358 output-dir : wheelhouse
5459 config-file : " {package}/pyproject.toml"
55- - uses : actions/upload-artifact@v4
60+
61+ - uses : actions/upload-artifact@v5
5662 with :
5763 name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
5864 path : ./wheelhouse/*.whl
@@ -61,14 +67,16 @@ jobs:
6167 name : Build source distribution
6268 runs-on : ubuntu-latest
6369 steps :
64- - uses : actions/checkout@v4
70+ - uses : actions/checkout@v6
6571
6672 - name : Build sdist
6773 run : pipx run build --sdist
68- - uses : actions/upload-artifact@v4
74+
75+ - uses : actions/upload-artifact@v5
6976 with :
7077 name : cibw-sdist
7178 path : dist/*.tar.gz
79+
7280 create_release :
7381 needs : [build_wheels, build_sdist]
7482 runs-on : ubuntu-latest
@@ -93,22 +101,24 @@ jobs:
93101 TAG_NAME=${FULL_TAG#prerelease-}
94102 IS_PRERELEASE=true
95103 else
96- echo "Tag does not match expected patterns" >&2
97- exit 1
104+ TAG_NAME=$FULL_TAG
105+ IS_PRERELEASE=false
98106 fi
99107 echo "FULL_TAG=$TAG_NAME" >> $GITHUB_ENV
100108 echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
101109 echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV
102- - uses : actions/download-artifact@v4
110+
111+ - uses : actions/download-artifact@v5
103112 with :
104113 # unpacks all CIBW artifacts into dist/
105114 pattern : cibw-*
106115 path : dist
107116 merge-multiple : true
117+
108118 - name : Create Draft Release
109119 id : create_release
110120 uses : softprops/action-gh-release@v2
111- if : startsWith(github.ref, 'refs/tags/')
121+ if : startsWith(github.ref, 'refs/tags/release-') || startsWith(github.ref, 'refs/tags/prerelease- ')
112122 env :
113123 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114124 with :
0 commit comments