@@ -132,6 +132,88 @@ jobs:
132132 fail_ci_if_error : false
133133 token : ${{ secrets.CODECOV_TOKEN }}
134134
135+ transpile :
136+ name : Transpile to C
137+ needs : dependencies
138+ runs-on : ubuntu-latest
139+ steps :
140+ - uses : actions/checkout@v4
141+ name : Checkout
142+
143+ - uses : actions/setup-python@v5
144+ name : Setup Python
145+ with :
146+ python-version : ${{ env.PYTHON_VERSION }}
147+
148+ - name : Install uv
149+ uses : astral-sh/setup-uv@v3
150+ with :
151+ enable-cache : true
152+
153+ - name : Create virtualenv
154+ run : |
155+ uv venv --system-site-packages
156+
157+ - name : Transpile
158+ run : uv run --frozen poe transpile
159+
160+ - name : Collect C Source
161+ run : |
162+ mkdir -p c_source
163+ find redux -name "*.c" -exec cp --parents {} c_source \;
164+ # Extract version for binary build
165+ git fetch --prune --unshallow
166+ git fetch --depth=1 origin +refs/tags/*:refs/tags/*
167+ uvx hatch version > c_source/VERSION
168+
169+ - name : Upload C Source
170+ uses : actions/upload-artifact@v4
171+ with :
172+ name : c-source
173+ path : c_source
174+ include-hidden-files : true
175+
176+ build_wheels :
177+ name : Build Wheels
178+ needs : transpile
179+ runs-on : ${{ matrix.os }}
180+ strategy :
181+ matrix :
182+ os : [ubuntu-latest, macos-latest, windows-latest]
183+ steps :
184+ - uses : actions/checkout@v4
185+ name : Checkout
186+
187+ - uses : actions/download-artifact@v4
188+ with :
189+ name : c-source
190+ path : .
191+
192+ - name : Swap Build System
193+ run : |
194+ mv pyproject_binary.toml pyproject.toml
195+ mv setup_binary.py setup.py
196+ shell : bash
197+
198+ - name : Read Version
199+ id : version
200+ shell : bash
201+ run : |
202+ ls -R
203+ echo "VERSION=$(cat VERSION)" >> "$GITHUB_ENV"
204+ echo "Read version: $(cat VERSION)"
205+
206+ - name : Build wheels
207+ 208+ env :
209+ CIBW_BUILD : cp311-* cp312-* cp313-* cp314-*
210+ CIBW_ENVIRONMENT : PRETEND_VERSION=${{ env.VERSION }}
211+
212+ - uses : actions/upload-artifact@v4
213+ with :
214+ name : wheels-${{ matrix.os }}
215+ path : ./wheelhouse/*.whl
216+
135217 build :
136218 name : Build
137219 needs :
@@ -215,6 +297,7 @@ jobs:
215297 - lint
216298 - test
217299 - build
300+ - build_wheels
218301 runs-on : ubuntu-latest
219302 environment :
220303 name : pypi
@@ -234,6 +317,12 @@ jobs:
234317 name : binary
235318 path : dist
236319
320+ - uses : actions/download-artifact@v4
321+ with :
322+ pattern : wheels-*
323+ path : dist
324+ merge-multiple : true
325+
237326 - name : Publish to PyPI
238327 uses : pypa/gh-action-pypi-publish@release/v1
239328 with :
@@ -272,6 +361,13 @@ jobs:
272361 name : binary
273362 path : artifacts
274363
364+ - name : Procure Wheels
365+ uses : actions/download-artifact@v4
366+ with :
367+ pattern : wheels-*
368+ path : artifacts
369+ merge-multiple : true
370+
275371 - name : Extract Changelog
276372 id : changelog
277373 run : |
0 commit comments