@@ -3,6 +3,20 @@ name: Release
33on :
44 push :
55 branches : [main]
6+ workflow_dispatch :
7+ inputs :
8+ force_release :
9+ description : ' Force release build (use existing tag)'
10+ required : false
11+ default : ' false'
12+ type : choice
13+ options :
14+ - ' false'
15+ - ' true'
16+ release_tag :
17+ description : ' Tag to release (e.g., cachekit-v0.1.0)'
18+ required : false
19+ type : string
620
721permissions :
822 contents : write
@@ -38,31 +52,51 @@ jobs:
3852 build-wheels :
3953 name : Build wheels (${{ matrix.target }})
4054 needs : release-please
41- if : needs.release-please.outputs.release_created == 'true'
55+ # Run if: release-please created a release OR manual dispatch with force_release
56+ if : needs.release-please.outputs.release_created == 'true' || github.event.inputs.force_release == 'true'
4257 strategy :
4358 matrix :
4459 include :
60+ # Native builds - maturin auto-discovers Python interpreters
4561 - os : ubuntu-latest
4662 target : x86_64-unknown-linux-gnu
47- - os : ubuntu-latest
48- target : aarch64-unknown-linux-gnu
4963 - os : macos-latest
5064 target : x86_64-apple-darwin
5165 - os : macos-latest
5266 target : aarch64-apple-darwin
5367 - os : windows-latest
5468 target : x86_64-pc-windows-msvc
69+ # Cross-compilation - must specify Python versions explicitly
70+ # (cross containers don't have discoverable Python interpreters)
71+ - os : ubuntu-latest
72+ target : aarch64-unknown-linux-gnu
73+ interpreter : -i python3.9 -i python3.10 -i python3.11 -i python3.12 -i python3.13
5574 runs-on : ${{ matrix.os }}
5675 steps :
5776 - uses : actions/checkout@v4
5877 with :
59- ref : ${{ needs.release-please.outputs.tag_name }}
78+ # Use release-please tag or manual input tag
79+ ref : ${{ needs.release-please.outputs.tag_name || github.event.inputs.release_tag }}
80+
81+ # Python setup required for native builds (macOS/Windows) to discover interpreters
82+ # Linux uses Docker containers which have Python pre-installed
83+ - name : Set up Python
84+ if : matrix.os != 'ubuntu-latest'
85+ uses : actions/setup-python@v5
86+ with :
87+ python-version : |
88+ 3.9
89+ 3.10
90+ 3.11
91+ 3.12
92+ 3.13
6093
6194 - uses : PyO3/maturin-action@v1
6295 with :
6396 target : ${{ matrix.target }}
64- args : --release --out dist
97+ args : --release --out dist ${{ matrix.interpreter }}
6598 manylinux : auto
99+ rust-toolchain : stable
66100
67101 - uses : actions/upload-artifact@v4
68102 with :
@@ -72,17 +106,18 @@ jobs:
72106 build-sdist :
73107 name : Build source distribution
74108 needs : release-please
75- if : needs.release-please.outputs.release_created == 'true'
109+ if : needs.release-please.outputs.release_created == 'true' || github.event.inputs.force_release == 'true'
76110 runs-on : ubuntu-latest
77111 steps :
78112 - uses : actions/checkout@v4
79113 with :
80- ref : ${{ needs.release-please.outputs.tag_name }}
114+ ref : ${{ needs.release-please.outputs.tag_name || github.event.inputs.release_tag }}
81115
82116 - uses : PyO3/maturin-action@v1
83117 with :
84118 command : sdist
85119 args : --out dist
120+ rust-toolchain : stable
86121
87122 - uses : actions/upload-artifact@v4
88123 with :
0 commit comments