Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Rust Release

Build, test and package a Rust project across a dynamic platform/architecture matrix. Two pieces, in pure shell:

  1. A composite action that emits a JSON build matrix (runner + Rust target triple per platform/arch) — consume it with fromJSON in your own workflow.
  2. A reusable workflow that fans out over that matrix: installs Rust, runs cargo build --release + cargo test for each target, then packages each as a zip containing the release binary and the release notes.

Reusable workflow (build + test + package)

jobs:
release:
uses: lite-actions/rust-release/.github/workflows/rust-release.yml@v1with:
rust-version: stable # optional; default: latest stableplatforms: "linux macos windows"architectures: "x86_64 aarch64"release-notes: RELEASE_NOTES.md # included in each zipupload-to-release: true # attach zips to the GitHub Release on a tag

Workflow inputs

InputDefaultDescription
rust-versionstableRust toolchain (latest stable).
platformslinuxSpace/comma list: linux, macos, windows.
architecturesx86_64Space/comma list: x86_64, aarch64.
bin-nameCargo.toml nameBinary to package.
release-notesRELEASE_NOTES.mdFile included in each zip.
upload-to-releasefalseAttach zips to the GitHub Release when run for a tag.

Tests run automatically when the crate has any (#[test] / #[cfg(test)] in src, or integration tests under tests/). If none are found, the test step is skipped and a notice is emitted — the build still proceeds and packages.

Matrix action only (dynamic matrix)

Use just the matrix generator and drive your own build job:

jobs:
matrix:
runs-on: ubuntu-latestoutputs:
matrix: ${{ steps.gen.outputs.matrix }}steps:
- id: genuses: lite-actions/rust-release@v1with:
platforms: "linux macos"architectures: "x86_64 aarch64"build:
needs: matrixstrategy:
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}runs-on: ${{ matrix.runner }}steps: [...]

The matrix output looks like:

{"include":[
{"platform":"linux","arch":"x86_64","runner":"ubuntu-latest","target":"x86_64-unknown-linux-gnu","rust-version":"stable"},
{"platform":"macos","arch":"aarch64","runner":"macos-latest","target":"aarch64-apple-darwin","rust-version":"stable"}
]}

Platform / architecture mapping

Each combination maps to a native runner (so tests run without cross-compilation):

platform / archrunnertarget triple
linux x86_64ubuntu-latestx86_64-unknown-linux-gnu
linux aarch64ubuntu-24.04-armaarch64-unknown-linux-gnu
macos x86_64macos-15-intelx86_64-apple-darwin
macos aarch64macos-latestaarch64-apple-darwin
windows x86_64windows-latestx86_64-pc-windows-msvc
windows aarch64windows-11-armaarch64-pc-windows-msvc

Unsupported combinations are skipped with a warning.

About

Dynamic-matrix Rust release: build/test across platform+arch and package each target (binary + release notes) as a zip. Composite action + reusable workflow, pure shell.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages