Skip to content

Add cross-platform release binaries#47

Merged
leynos merged 3 commits intomainfrom
codex/update-release-process-for-multiple-platforms
Jun 15, 2025
Merged

Add cross-platform release binaries#47
leynos merged 3 commits intomainfrom
codex/update-release-process-for-multiple-platforms

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jun 15, 2025

Summary

  • release x64/aarch64 binaries for linux, freebsd, macos, windows and openbsd
  • upload each binary as soon as it builds
  • document how releases are produced

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • RUSTFLAGS="-D warnings" cargo test
  • markdownlint docs/release-process.md

https://chatgpt.com/codex/tasks/task_e_684ed4dd83848322b20ee72a8d67d9fb

Summary by Sourcery

Enable cross-platform release binary production by extending GitHub Actions with a build matrix, cross compilation, immediate artifact uploads, and accompanying documentation.

New Features:

  • Publish prebuilt x86_64 and aarch64 binaries across Linux, FreeBSD, macOS, Windows, and OpenBSD.

Enhancements:

  • Refactor the release workflow to use a matrix strategy and cross for cross-compilation.

CI:

  • Install cross in CI, build each target via matrix, upload artifacts per OS-architecture, and batch upload them in the release job.

Documentation:

  • Add docs/release-process.md to document the multi-platform release workflow and artifact naming.

Summary by CodeRabbit

  • New Features

    • Release process now provides prebuilt binaries for multiple operating systems (Linux, Windows, macOS, FreeBSD, OpenBSD) and CPU architectures (x86_64, aarch64).
    • Multi-platform cross-compilation and individual platform-specific binary uploads have been introduced for improved release management.
  • Documentation

    • Added documentation outlining the release process and supported platforms for prebuilt binaries.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jun 15, 2025

Reviewer's Guide

This PR refactors the GitHub Actions workflow to produce and publish prebuilt release binaries across multiple operating systems and architectures by integrating a build matrix with the cross tool, automating per-target packaging and upload steps, and adds documentation outlining the process and naming conventions.

Sequence Diagram for Publishing Release Binaries

sequenceDiagram
    participant Runner as GitHub Actions Runner (Release Job)
    participant ReleaseCreator as softprops/action-gh-release
    participant GH_API as GitHub API
    participant WorkflowArtifacts as GitHub Workflow Artifacts
    participant GH_Releases as GitHub Releases

    Runner->>+ReleaseCreator: Create Release (generate_release_notes: true)
    ReleaseCreator->>+GH_API: Create/Update GitHub Release entry
    GH_API-->>-ReleaseCreator: Release created/updated
    ReleaseCreator-->>-Runner: Release shell ready

    Runner->>+WorkflowArtifacts: Download all artifacts (actions/download-artifact to ./artifacts/)
    WorkflowArtifacts-->>-Runner: Artifacts downloaded

    loop For each artifact in ./artifacts/
        Runner->>Runner: Identify next artifact file
        Runner->>+GH_Releases: gh release upload "<tag>" "<file>"
        GH_Releases-->>-Runner: Artifact uploaded
    end
Loading

File-Level Changes

Change Details Files
Introduce cross-platform build matrix
  • Define os/arch/target/ext combinations for Linux, Windows, macOS, FreeBSD, OpenBSD
  • Configure GitHub Actions strategy.matrix with ten platform-arch entries
.github/workflows/release.yml
Integrate cross tool for cross-compilation
  • Add step to install the cross crate from GitHub
  • Replace cargo build with cross build --release --target
.github/workflows/release.yml
Streamline artifact preparation and upload
  • Create artifacts directory and copy each binary with <name>-<os>-<arch> naming
  • Update upload-artifact step to use per-platform paths
  • Modify release job to download all artifacts and loop gh release upload over them
.github/workflows/release.yml
Document the release process
  • Add docs/release-process.md detailing supported platforms and naming conventions
  • Explain immediate artifact upload behavior
docs/release-process.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 15, 2025

Warning

Rate limit exceeded

@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 19 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 655c5e6 and ad76ed1.

📒 Files selected for processing (2)
  • .github/workflows/release.yml (3 hunks)
  • docs/release-process.md (1 hunks)

Walkthrough

The release workflow was updated to support cross-compilation and multi-platform binary releases using a matrix strategy in GitHub Actions. The process now builds and uploads binaries for several OS and architecture combinations. Additionally, new documentation was added detailing the updated release process and naming conventions.

Changes

File(s) Change Summary
.github/workflows/release.yml Enhanced to use a build matrix for cross-compilation across multiple OS/architectures; updated artifact naming and upload logic to handle multiple platform-specific binaries.
docs/release-process.md New documentation file describing the multi-platform release process, supported platforms, and binary naming conventions.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant GitHub Actions
    participant cross
    participant Artifacts
    participant Release

    Developer->>GitHub Actions: Push tag / trigger release workflow
    GitHub Actions->>cross: Build binaries for each OS/arch (matrix)
    cross-->>GitHub Actions: Compiled binaries per target
    GitHub Actions->>Artifacts: Upload binaries with platform-specific names
    GitHub Actions->>Release: Download all artifacts
    loop For each binary
        GitHub Actions->>Release: Upload binary to GitHub Release
    end
Loading

Possibly related PRs

  • Add release workflow #3: Implements the initial single-platform Linux release workflow, which is now extended in this PR to support cross-compilation and multi-platform releases.

Poem

🐇
Across the clouds our binaries hop,
From Linux to Windows, they never stop!
Mac, BSD, all join the spree,
With artefacts named so carefully.
Now every platform gets its fix—
Release day magic, code and tricks!

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch codex/update-release-process-for-multiple-platforms
  • Post Copyable Unit Tests in Comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @leynos - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
docs/release-process.md (2)

16-17: Add a comma for better readability
A comma after “built” improves the sentence flow and clarifies the pause.

- Binaries are uploaded as soon as they are built so they are available from the
+ Binaries are uploaded as soon as they are built, so they are available from the
🧰 Tools
🪛 LanguageTool

[uncategorized] ~16-~16: Possible missing comma found.
Context: ...naries are uploaded as soon as they are built so they are available from the workflow...

(AI_HYDRA_LEO_MISSING_COMMA)


5-17: Expand the release documentation with workflow details
The file currently lists supported targets but omits key details on the GitHub Actions matrix strategy, the cross tool installation, artifact naming conventions and the exact upload commands. Consider adding sections that cover:

  • How the matrix is defined in .github/workflows/release.yml
  • The cross installation and build steps
  • The naming pattern mdtablefix-<os>-<arch>[.exe]
  • The artefact upload loop to GitHub Releases
🧰 Tools
🪛 LanguageTool

[uncategorized] ~16-~16: Possible missing comma found.
Context: ...naries are uploaded as soon as they are built so they are available from the workflow...

(AI_HYDRA_LEO_MISSING_COMMA)

.github/workflows/release.yml (1)

64-66: Pin cross installation for reproducibility
Installing from the default branch may introduce breaking changes over time. Pin to a specific release tag or commit:

- run: cargo install cross --git https://github.com/cross-rs/cross
+ run: cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.1
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1a4fa7 and f706df7.

📒 Files selected for processing (2)
  • .github/workflows/release.yml (3 hunks)
  • docs/release-process.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/release-process.md

[uncategorized] ~16-~16: Possible missing comma found.
Context: ...naries are uploaded as soon as they are built so they are available from the workflow...

(AI_HYDRA_LEO_MISSING_COMMA)

🪛 actionlint (1.7.7)
.github/workflows/release.yml

59-59: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test
🔇 Additional comments (3)
.github/workflows/release.yml (3)

14-32: Matrix strategy correctly enumerates all targets
The strategy covers Linux, Windows, macOS, FreeBSD and OpenBSD on both x86_64 and aarch64 architectures, aligning perfectly with the PR objectives.


59-63: Skip actionlint warning on actions-rs/toolchain@v1
The v1 tag is an alias that always points to the latest stable release. This lint warning is a known false positive.

🧰 Tools
🪛 actionlint (1.7.7)

59-59: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


93-103: Release job uploads platform-specific binaries
The loop correctly iterates over all downloaded artefacts and uploads each one individually to the GitHub Release, replacing the previous single-binary approach.

🧰 Tools
🪛 actionlint (1.7.7)

94-94: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

- Add matrix details, artifact naming and upload description- Pin cross install to v0.2.1- Fix grammar for binary upload sentence
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (8)
docs/release-process.md (4)

5-5: Clarify workflow file path.

Consider specifying the full path .github/workflows/release.yml instead of just release.yml to make the file location explicit for readers.


23-23: Add comma after introductory phrase.

For readability, insert a comma after “build job”:
“During the build job, cross compiles a release binary for every matrix row.”

🧰 Tools
🪛 LanguageTool

[uncategorized] ~23-~23: Possible missing comma found.
Context: ...extension for Windows. During the build job cross compiles a release binary for e...

(AI_HYDRA_LEO_MISSING_COMMA)


30-30: Insert missing comma after subordinate clause.

Revise to:
“After every build completes, the artifact is uploaded so that the GitHub Actions interface provides it immediately.”

🧰 Tools
🪛 LanguageTool

[uncategorized] ~30-~30: A comma might be missing here.
Context: ...--[.exe]`. After every build completes the artifact is uploaded so that the Gi...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


31-31: Separate clauses with a comma.

Update to:
“Once the matrix has finished, the release job downloads all artifacts and uploads them to the GitHub release using gh release upload.”

🧰 Tools
🪛 LanguageTool

[uncategorized] ~31-~31: A comma might be missing here.
Context: ...des it immediately. Once the matrix has finished the release job downloads all artifac...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)

.github/workflows/release.yml (4)

59-59: Pin actions-rs/toolchain to a specific patch version.

Using actions-rs/toolchain@v1 may resolve to older releases. Consider pinning to the latest patch (for example, actions-rs/toolchain@v1.3.0) for consistent behaviour on GitHub runners.

🧰 Tools
🪛 actionlint (1.7.7)

59-59: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


64-65: Cache the cross binary to speed up matrix jobs.

Installing cross fresh in each job adds overhead. You could cache ~/.cargo/bin/cross (or the entire Cargo bin directory) via actions/cache so subsequent runs reuse the tool.


80-82: Scope artifacts into per-matrix subdirectories.

Writing all outputs into a single artifacts folder risks filename collisions if jobs ever share a workspace. Consider using artifacts/${{ matrix.os }}-${{ matrix.arch }} and updating the upload paths accordingly.


101-103: Provide checksums for binary integrity.

After building, generate SHA-256 checksums (e.g. via sha256sum) and upload the .sha256 files alongside each artifact. This allows consumers to verify downloads.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f706df7 and 655c5e6.

📒 Files selected for processing (2)
  • .github/workflows/release.yml (3 hunks)
  • docs/release-process.md (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/release.yml

59-59: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 LanguageTool
docs/release-process.md

[uncategorized] ~23-~23: Possible missing comma found.
Context: ...extension for Windows. During the build job cross compiles a release binary for e...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~30-~30: A comma might be missing here.
Context: ...--[.exe]`. After every build completes the artifact is uploaded so that the Gi...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~31-~31: A comma might be missing here.
Context: ...des it immediately. Once the matrix has finished the release job downloads all artifac...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test
🔇 Additional comments (2)
docs/release-process.md (1)

1-34: Documentation is comprehensive and coherent.

The multi-platform release workflow and naming conventions are clearly described and align with the implementation in the Actions workflow.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~23-~23: Possible missing comma found.
Context: ...extension for Windows. During the build job cross compiles a release binary for e...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~30-~30: A comma might be missing here.
Context: ...--[.exe]`. After every build completes the artifact is uploaded so that the Gi...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~31-~31: A comma might be missing here.
Context: ...des it immediately. Once the matrix has finished the release job downloads all artifac...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)

.github/workflows/release.yml (1)

1-106: Well-structured multi-platform release workflow.

The matrix build using cross and the two-stage artifact upload closely follow the documented process and effectively support cross-platform binaries.

🧰 Tools
🪛 actionlint (1.7.7)

59-59: the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


94-94: the runner of "softprops/action-gh-release@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

- Pin toolchain action to v1.3.0- Cache cross binary for faster builds- Place artifacts in per-target directories with checksums- Document path and punctuation fixes in release guide
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Jun 15, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 15, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@leynos leynos merged commit 9e0d469 into main Jun 15, 2025
3 checks passed
@leynos leynos deleted the codex/update-release-process-for-multiple-platforms branch June 15, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant