chore(build): build wheels for multiple platforms#281
Merged
jericht merged 1 commit intoJun 23, 2026
Conversation
jericht
force-pushed
the
jericht/multi_platform_build
branch
7 times, most recently
from
June 19, 2026 17:27
210de4d to
332ca19
Compare
leongdl
reviewed
Jun 19, 2026
| with: | ||
| tag: ${{ needs.TagRelease.outputs.tag }} | ||
| needs: [TagRelease, PreRelease] | ||
| uses: OpenJobDescription/.github/.github/workflows/reusable_release.yml@mainline |
Contributor
There was a problem hiding this comment.
This is the key line to call to the shared workflow right?
Contributor
Author
There was a problem hiding this comment.
This is actually an existing release flow, the above one (reusable_maturin_prerelease) is the new reusable workflow added in OpenJobDescription/.github#17
jericht
marked this pull request as ready for review
June 20, 2026 00:35
jericht
force-pushed
the
jericht/multi_platform_build
branch
from
June 20, 2026 01:40
332ca19 to
46847ca
Compare
jericht
commented
Jun 20, 2026
Comment on lines
-57
to
-59
| Publish: | ||
| needs: [TagRelease, Release] | ||
| uses: OpenJobDescription/.github/.github/workflows/reusable_publish_python.yml@mainline |
Contributor
Author
There was a problem hiding this comment.
This step is being removed because we are moving away from the CodeBuild based internal build system.
leongdl
approved these changes
Jun 22, 2026
leongdl
reviewed
Jun 22, 2026
| @@ -35,57 +35,36 @@ jobs: | |||
| tag: ${{ needs.TagRelease.outputs.tag }} | |||
|
|
|||
| PreRelease: | |||
Contributor
There was a problem hiding this comment.
btw, this is how I reviewed it. I asked my agent to look at the before and after, and sanity check the paths:
Here's the summary of the release workflow changes:
Before (current mainline)
The workflow pipeline is:
1. TagRelease → creates a git tag
2. UnitTests → runs code quality checks
3. PreRelease → uses reusable_prerelease.yml (generic pre-release)
4. Release → uses reusable_release.yml (creates the GitHub Release)
5. Publish → uses reusable_publish_python.yml (a separate reusable workflow step)
6. PublishToPyPI → checks out the tag, sets up Python 3.9, installs hatch, runs hatch -v build to build the package locally on a single Ubuntu runner, then publishes the resulting wheel/sdist to PyPI via trusted
publishing
The key point: the build happens at PyPI-publish time on a single Ubuntu runner using hatch build. This produces a single pure-Python py3-none-any wheel since there was no native code.
After (this PR)
The workflow pipeline becomes:
1. TagRelease → same
2. UnitTests → same
3. PreRelease → now uses reusable_maturin_prerelease.yml — a new reusable workflow that builds platform-specific wheels via maturin across multiple OS/arch combinations (macOS x86_64/arm64, Linux x86_64/aarch64,
Windows amd64/arm64). It also no longer requests id-token/contents: write permissions itself.
4. Release → same reusable workflow (creates GitHub Release), now with explicit permissions
5. Publish job is removed entirely
6. PublishToPyPI → no longer checks out code or builds anything. Instead it downloads the pre-built build-artifact (the multi-platform wheels produced by PreRelease) and publishes them directly to PyPI.
Dependencies changed from [TagRelease, Publish] to [TagRelease, Release, PreRelease].
Other changes
- _build_backend.py: On Windows, sets CARGO_TARGET_DIR=C:\cargo-target to avoid MSVC linker failures from long paths when building from an extracted sdist.
- scripts/maturin_build.py: Adds a --version-only flag that patches version into pyproject.toml and _version.py without running maturin — used by CI when maturin-action handles the actual compilation but needs
the version injected beforehand.
leongdl
approved these changes
Jun 22, 2026
seant-aws
approved these changes
Jun 23, 2026
godobyte
reviewed
Jun 23, 2026
godobyte
approved these changes
Jun 23, 2026
Replace the single-platform hatch build with a GitHub Actions matrix that builds native wheels for linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows (x86_64, arm64) using maturin-action. Add --version-only flag to scripts/maturin_build.py so CI can inject the VCS version into pyproject.toml before maturin-action runs. Signed-off-by: Jericho Tolentino <68654047+jericht@users.noreply.github.com>
jericht
force-pushed
the
jericht/multi_platform_build
branch
from
June 23, 2026 19:07
46847ca to
30a6fca
Compare
jericht
enabled auto-merge (squash)
June 23, 2026 19:07
jericht
disabled auto-merge
June 23, 2026 19:07
jericht
enabled auto-merge (squash)
June 23, 2026 19:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was the problem/requirement? (What/Why)
The package now contains a native Rust extension (PyO3 bindings). Previously,
openjd-modelwas pure Python and a singlepy3-none-anywheel worked on all platforms. With native code, we need to build and publish one wheel per platform so that pip install works without requiring a Rust toolchain on the target machine.What was the solution? (How)
Update the GitHub release workflow to use
maturinto build wheels on each target platform (Mac, Windows, Linux, on both x86_64 and ARM architectures).Reusable workflows are being added to the
.githubrepo in this PR (will be reused in openjd-sessions as well): OpenJobDescription/.github#17What is the impact of this change?
Starting from the next release, we will have platform specific wheels published to PyPI.
pip install openjd-modelwill resolve a pre-built native wheel on all supported platforms. Users no longer need a Rust toolchain to install the package on Windows, macOS, or Linux.How was this change tested?
Made a test branch that runs the multi platform build and downloads the artifacts and shows they are in the correct folder layout as expected: https://github.com/jericht/openjd-model-for-python/actions/runs/27854658792
Output from above run:
Example verification on Windows runner:
Was this change documented?
N/A
Is this a breaking change?
No.
Does this change impact security?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.