🚀 ci: fix wheel build — drop broken maturin-action inputs, direct maturin+zig, correct pyproject URLs
swadhinbiswas committed 2 months ago
3537c75
1 parent 4322714
commit 3537c75
2 files changed
+63 -27
Showing 2 changed files+63-27
▼.github/workflows/wheels.yml
+59-23
| @@ -56,28 +56,41 @@ jobs: | ||
56 | 56 | matrix: |
57 | 57 | include: |
58 | 58 | - os: ubuntu-latest |
59 | - target: x86_64 | |
60 | - args: --manylinux 2_28 | |
59 | + target: x86_64-unknown-linux-gnu | |
60 | + rust-target: x86_64-unknown-linux-gnu | |
61 | + zig: true | |
61 | 62 | - os: ubuntu-latest |
62 | - target: aarch64 | |
63 | - args: --manylinux 2_28 | |
63 | + target: aarch64-unknown-linux-gnu | |
64 | + rust-target: aarch64-unknown-linux-gnu | |
65 | + zig: true | |
64 | 66 | - os: ubuntu-latest |
65 | - target: x86_64 | |
66 | - args: --musllinux 1_2 | |
67 | + target: x86_64-unknown-linux-musl | |
68 | + rust-target: x86_64-unknown-linux-musl | |
69 | + zig: true | |
70 | + - os: ubuntu-latest | |
71 | + target: aarch64-unknown-linux-musl | |
72 | + rust-target: aarch64-unknown-linux-musl | |
73 | + zig: true | |
67 | 74 | - os: macos-latest |
68 | - target: x86_64 | |
75 | + target: aarch64-apple-darwin | |
76 | + rust-target: aarch64-apple-darwin | |
69 | 77 | - os: macos-latest |
70 | - target: aarch64 | |
78 | + target: x86_64-apple-darwin | |
79 | + rust-target: x86_64-apple-darwin | |
80 | + zig: true | |
71 | 81 | - os: windows-latest |
72 | - target: x64 | |
82 | + target: x86_64-pc-windows-msvc | |
83 | + rust-target: x86_64-pc-windows-msvc | |
73 | 84 | # Free-threaded CPython (3.14t): parallel GIL-free execution. The |
74 | - # limited API (abi3) cannot be free-threaded, so these builds use | |
85 | + # limited API (abi3) cannot be free-threaded, so this build passes | |
75 | 86 | # --no-default-features (abi3 is the only default feature that must |
76 | - # go; mail/http3/orjson stay). | |
87 | + # go; mail/http3/orjson stay) and targets the 3.14t interpreter. | |
77 | 88 | - os: ubuntu-latest |
78 | - target: x86_64 | |
89 | + target: x86_64-unknown-linux-gnu | |
90 | + rust-target: x86_64-unknown-linux-gnu | |
79 | 91 | python: "3.14t" |
80 | - args: --manylinux 2_28 --no-default-features --features mail,http3,orjson | |
92 | + zig: true | |
93 | + features: "--no-default-features --features mail,http3,orjson" | |
81 | 94 | |
82 | 95 | steps: |
83 | 96 | - uses: actions/checkout@v4 |
| @@ -86,24 +99,47 @@ jobs: | ||
86 | 99 | python-version: ${{ matrix.python || '3.12' }} |
87 | 100 | enable-cache: true |
88 | 101 | cache-dependency-glob: crates/justapi-py/pyproject.toml |
89 | - - name: Build wheels via Maturin | |
90 | - uses: PyO3/maturin-action@v1 | |
102 | + - uses: dtolnay/rust-toolchain@stable | |
103 | + with: | |
104 | + targets: ${{ matrix.rust-target }} | |
105 | + - name: Install maturin | |
106 | + shell: bash | |
107 | + run: | | |
108 | + uv tool install maturin | |
109 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
110 | + - name: Install Zig (for cross-compilation) | |
111 | + if: matrix.zig == 'true' | |
112 | + uses: mlugg/setup-zig@v1 | |
91 | 113 | with: |
92 | - target: ${{ matrix.target }} | |
93 | - args: --release --out dist ${{ matrix.args }} | |
94 | - manifest-path: crates/justapi-py/Cargo.toml | |
95 | - interpreter: ${{ matrix.python || '' }} | |
114 | + # Matches the zig version verified locally (all 5 wheels built with | |
115 | + # maturin 1.14.1 + zig 0.16.0 on 2026-08-07). | |
116 | + version: 0.16.0 | |
117 | + - name: Resolve free-threaded interpreter | |
118 | + if: matrix.python == '3.14t' | |
119 | + shell: bash | |
120 | + run: echo "PY314T=$(uv python find 3.14t)" >> "$GITHUB_ENV" | |
121 | + - name: Build wheel (maturin + zig cross) | |
122 | + shell: bash | |
123 | + working-directory: crates/justapi-py | |
124 | + run: | | |
125 | + INTERP="" | |
126 | + if [ -n "${{ matrix.python }}" ]; then INTERP="--interpreter ${{ env.PY314T }}"; fi | |
127 | + ZIG="" | |
128 | + if [ "${{ matrix.zig }}" = "true" ]; then ZIG="--zig"; fi | |
129 | + maturin build --release --out dist $ZIG --target ${{ matrix.target }} \ | |
130 | + $INTERP ${{ matrix.features || '' }} | |
96 | 131 | - name: Install wheel & test |
97 | 132 | shell: bash |
133 | + working-directory: crates/justapi-py | |
98 | 134 | run: | |
99 | - uv venv | |
100 | - uv pip install dist/*.whl pytest | |
101 | - uv run python -m pytest crates/justapi-py/tests/ -v --tb=short | |
135 | + uv venv --python ${{ matrix.python || '3.12' }} "$RUNNER_TEMP/wtest" | |
136 | + uv pip install --python "$RUNNER_TEMP/wtest/bin/python" "dist/*.whl[test]" requests | |
137 | + "$RUNNER_TEMP/wtest/bin/python" -m pytest tests/ -v --tb=short | |
102 | 138 | - name: Upload Wheels |
103 | 139 | uses: actions/upload-artifact@v4 |
104 | 140 | with: |
105 | 141 | name: wheels-${{ matrix.os }}-${{ matrix.target }}-${{ strategy.job-index }} |
106 | - path: dist/*.whl | |
142 | + path: crates/justapi-py/dist/*.whl | |
107 | 143 | |
108 | 144 | publish: |
109 | 145 | name: Publish to PyPI + GitHub Release |
110 | 146 | |
▼crates/justapi-py/pyproject.toml
+4-4
| @@ -58,10 +58,10 @@ test = [ | ||
58 | 58 | ] |
59 | 59 | |
60 | 60 | [project.urls] |
61 | -Homepage = "https://github.com/anomalyco/justapi" | |
62 | -Repository = "https://github.com/anomalyco/justapi" | |
63 | -Documentation = "https://github.com/anomalyco/justapi#readme" | |
64 | -"Bug Tracker" = "https://github.com/anomalyco/justapi/issues" | |
61 | +Homepage = "https://github.com/swadhinbiswas/JustAPI" | |
62 | +Repository = "https://github.com/swadhinbiswas/JustAPI" | |
63 | +Documentation = "https://github.com/swadhinbiswas/JustAPI#readme" | |
64 | +"Bug Tracker" = "https://github.com/swadhinbiswas/JustAPI/issues" | |
65 | 65 | |
66 | 66 | [tool.maturin] |
67 | 67 | module-name = "justapi._justapi" |
68 | 68 | |