Corprus Crucible Manufacturing

.github/workflows/rustGlobalBuild.yml

Source: .github/workflows/rustGlobalBuild.yml · reusable workflow

Manufacture Rust application releases across desktop and opt-in portable targets.

Intended for: Binary repositories, including directory-based monorepos and root workspace package/bin selection.

Release behavior#

Verification and release builds start together: one lint job (fmt, audit, MSRV, packaging dry runs), a test job per desktop that runs Clippy twice (every feature, and the features its release ships) and the tests, and the platform builds, of which Android and PortMaster lint their own cross builds. The tests run the default cargo test targets (library, binaries, integration tests, doctests, examples built), never the benches, which Clippy lints. publish runs only when all of them pass: it packs muOS apps, refreshes the GitHub Release, uploads archives and the changelog, and on tags opens dependent issues. Tags publish crates. Nexus uploads, AUR, rustdoc and the Mod Template stage follow publish; a pull request checks its site from the start instead (site-check). Benchmarks run on tags with generate_benchmarks, through benchmarks.yml.

Artifacts and effects#

  • Per-binary/per-platform archives and Cosign verification bundles
  • Workflow staging artifacts and VirusTotal release links
  • Optional rustdoc Pages, changelog and benchmark documents
  • Configured crates.io, AUR and Nexus publication

Assumptions and permissions#

  • Caller grants contents: write, id-token: write for signing, and pages: write when deploying docs.
  • VT_API_KEY is operationally required for non-PR binary releases even though the reusable input marks the secret optional.
  • binary_names is a JSON array. binary_package overrides directory detection with --package or --workspace.
  • CARGO_REGISTRY_TOKEN is required when cargo_publish is enabled. Set cargo_publish: false deliberately when appropriate.
  • The caller's StroggForge ref must contain every helper referenced by the workflows/actions.

Failure modes#

  • Compiler/LLVM major mismatch: inspect rust-setup, setup-llvm.sh and the platform matrix.
  • Clippy with the features the release ships fails where Clippy with every feature passes: code dead or broken in that platform's feature set, from .stroggforge/cargo-build-args.sh.
  • Missing VT token, signing OIDC permission, Nexus group IDs or registry token: inspect the failing stage, not the archive name.
  • A failed test or lint on one platform holds back publish even though every build finished: builds do not wait for tests, publishing does.

Example#

Use the generated binary caller template. Read publishing before pushing a tag.

Inputs#

NameTypeRequiredDefaultDescription
aur_package_namestringfalse—
binary_namesstringtrue—JSON array of binary names to compile.
binary_packagestringfalseCargo package that provides the binaries, built from the repository root with --package <name> --bin <binary>. Set workspace to build with --workspace --bin <binary>. Empty keeps directory detection.
cargo_publishbooleanfalsetruePublish to crates.io on tagged releases; run a dry-run on all other pushes. Requires CARGO_REGISTRY_TOKEN secret.
cargo_publish_workspacebooleanfalsefalsePublish every publishable workspace member in dependency order instead of one crate per binary name. Skips versions already on crates.io and waits out crates.io rate limits.
dependent_repo_namesstringfalseDependent repositories to notify on tagged releases, one owner/repo per line. JSON arrays are still accepted for compatibility.
development_releasestringfalsedevelopmentThe rolling pre-release, and its tag, that pushes to the default branch refresh. Change it only when that name can't be used, such as a tag GitHub keeps for an immutable release.
enable_androidbooleanfalsefalseBuild and publish Android ARM64 ELF release artifacts targeting Android API level 23. This does not build an APK.
enable_portmasterbooleanfalsefalseBuild and publish Portmaster ARM64 release artifacts targeting aarch64-unknown-linux-gnu cross-compiled with clang and lld against an EL9 (glibc 2.34) sysroot.
generate_benchmarksbooleanfalsefalseRun cargo bench, generate BENCHMARKS.md from Criterion output or the raw benchmark log, and upload it to the release.
generate_changelogbooleanfalsetrueGenerate a CHANGELOG.md from git history and upload it to the release.
generate_discord_notificationbooleanfalsetrueGenerate a discord notification to DreamWeave upon success.
git_emailstringfalsecorleycomputerrepair@protonmail.ch—
git_usernamestringfalsemagicaldave—
gpu_testsbooleanfalsefalseGive the Linux tests a GPU: Mesa's software Vulkan driver (lavapipe), so tests that skip without an adapter run. macOS and Windows runners have one already.
include_filesstringfalseREADME.md,LICENSEAdditional files or directories to include in platform archives (comma-separated).
mod_templatebooleanfalsefalseThe repository is a DreamWeave Mod Template site. After the release is published, modGlobalBuild records its archives in mod.lock and builds and deploys the site. Replaces rustdoc Pages; the caller also grants actions: write.
msrvstringfalseMinimum supported Rust version to check the workspace against before release, e.g. '1.88'. 'auto' reads rust-version from Cargo.toml. Empty skips the check.
muxapp_dirstringfalseA directory in the repository holding muOS app files (mux_launch.sh and the rest). Each PortMaster archive is packaged with them as <binary>-Portmaster-ARM64.muxapp and published beside it. Requires enable_portmaster.
publish_docsbooleanfalsetrueBuild cargo doc and deploy to GitHub Pages. Disable if the project uses its own SSG.

Secrets#

NameTypeRequiredDefaultDescription
AUR_SSH_PRIVATE_KEY—false——
CARGO_REGISTRY_TOKEN—false——
DISCORD_CHANNEL_WEBHOOK—false——
DW_BOT_PAT—false——
DW_TOOLS_CHANNEL_WEBHOOK—false——
NEXUS_API_KEY—false——
NEXUS_GROUP_IDS—false——
VT_API_KEY—false——

Permissions#

Top-level: —. Undeclared means inherited from the caller, not "none needed".

Job dependency graph#

Edges are YAML needs; conditional jobs may not run. Conditions are listed below.

workflow-rustGlobalBuild relationship diagram. Its textual ledger or workflow contract is on this page or linked below.
workflow rustGlobalBuild · Mermaid source · Full-size SVG
Read diagram source
flowchart TD
  n_aur["aur"]
  n_benchmarks["benchmarks"]
  n_crates["crates"]
  n_docs["docs"]
  n_lint["lint"]
  n_mod_template["mod-template"]
  n_nexus["nexus"]
  n_notify["notify"]
  n_publish["publish"]
  n_release["release"]
  n_release_android["release-android"]
  n_release_linux["release-linux"]
  n_release_portmaster["release-portmaster"]
  n_site_check["site-check"]
  n_test["test"]
  n_publish --> n_aur
  n_publish --> n_benchmarks
  n_lint --> n_crates
  n_test --> n_crates
  n_release --> n_crates
  n_release_linux --> n_crates
  n_release_android --> n_crates
  n_release_portmaster --> n_crates
  n_lint --> n_docs
  n_test --> n_docs
  n_publish --> n_mod_template
  n_crates --> n_mod_template
  n_publish --> n_nexus
  n_lint --> n_notify
  n_test --> n_notify
  n_release --> n_notify
  n_release_linux --> n_notify
  n_release_android --> n_notify
  n_release_portmaster --> n_notify
  n_publish --> n_notify
  n_nexus --> n_notify
  n_crates --> n_notify
  n_aur --> n_notify
  n_docs --> n_notify
  n_benchmarks --> n_notify
  n_mod_template --> n_notify
  n_lint --> n_publish
  n_test --> n_publish
  n_release --> n_publish
  n_release_linux --> n_publish
  n_release_android --> n_publish
  n_release_portmaster --> n_publish

Jobs#

JobNeedsRunner / delegateContainer / strategyCondition
aurpublishubuntu-latest / —— / —needs.publish.result == 'success' && github.event_name == 'push' && inputs.aur_package_name != ''
benchmarkspublish— / DreamWeave-MP/StroggForge/.github/workflows/benchmarks.yml@v72— / —inputs.generate_benchmarks && github.ref_type == 'tag' && needs.publish.result == 'success'
crateslint, test, release, release-linux, release-android, release-portmasterubuntu-24.04 / —— / —always() && !cancelled() && inputs.cargo_publish && github.ref_type == 'tag' && needs.lint.result == 'success' && needs.test.result == 'success' && needs.release.result == 'success' && needs.release-linux.result == 'success' && (!inputs.enable_android || needs.release-android.result == 'success') && (!inputs.enable_portmaster || needs.release-portmaster.result == 'success')
docslint, testubuntu-24.04 / —— / —inputs.publish_docs && !inputs.mod_template && github.event_name == 'push' && github.ref == 'refs/heads/main'
lintubuntu-24.04 / —— / ——
mod-templatepublish, crates— / DreamWeave-MP/StroggForge/.github/workflows/modGlobalBuild.yml@v72— / —always() && !cancelled() && inputs.mod_template && github.event_name != 'pull_request' && needs.publish.result == 'success'
nexuspublishubuntu-24.04 / —— / {"fail-fast":false,"matrix":{"upload":"${{ fromJson(needs.publish.outputs.nexus) }}"}}needs.publish.result == 'success' && needs.publish.outputs.nexus != '[]'
notifylint, test, release, release-linux, release-android, release-portmaster, publish, nexus, crates, aur, docs, benchmarks, mod-template— / DreamWeave-MP/StroggForge/.github/workflows/discord.yml@v72— / —always() && !cancelled() && inputs.generate_discord_notification && github.event_name == 'push'
publishlint, test, release, release-linux, release-android, release-portmasterubuntu-24.04 / —— / —always() && !cancelled() && github.event_name != 'pull_request' && needs.lint.result == 'success' && needs.test.result == 'success' && needs.release.result == 'success' && needs.release-linux.result == 'success' && (!inputs.enable_android || needs.release-android.result == 'success') && (!inputs.enable_portmaster || needs.release-portmaster.result == 'success')
release${{ matrix.os }} / —— / {"fail-fast":false,"matrix":{"os":["macos-latest","macos-26-intel","windows-2025-vs2026"],"app_names":"${{ fromJson(inputs.binary_names) }}"}}—
release-androidubuntu-latest / —— / {"fail-fast":false,"matrix":{"app_names":"${{ fromJson(inputs.binary_names) }}"}}inputs.enable_android
release-linuxubuntu-latest / —ghcr.io/dreamweave-mp/stroggforge-linux-x86_64-el9-builder:v72 / {"fail-fast":false,"matrix":{"app_names":"${{ fromJson(inputs.binary_names) }}"}}—
release-portmasterubuntu-latest / —ghcr.io/dreamweave-mp/stroggforge-portmaster-aarch64-el9-builder:v72 / {"fail-fast":false,"matrix":{"app_names":"${{ fromJson(inputs.binary_names) }}"}}inputs.enable_portmaster
site-check— / DreamWeave-MP/StroggForge/.github/workflows/modGlobalBuild.yml@v72— / —inputs.mod_template && github.event_name == 'pull_request'
test${{ matrix.os }} / —— / {"fail-fast":false,"matrix":{"include":[{"os":"macos-latest","platform_os":"macOS","platform_arch":"ARM64"},{"os":"macos-26-intel","platform_os":"macOS","platform_arch":"X64"},{"os":"ubuntu-22.04","platform_os":"Linux","platform_arch":"X64"},{"os":"windows-2025-vs2026","platform_os":"Windows","platform_arch":"X64"}]}}—

Steps#

aur#

StepAction / commandCondition
—actions/checkout@v6—
—varrcan/aur-publish-action@v1—

benchmarks#

StepAction / commandCondition

crates#

StepAction / commandCondition
—actions/checkout@v6—
—actions/checkout@v6—
—DreamWeave-MP/StroggForge/.github/actions/rust-setup@v72—
Publish to crates.ioif [ "$PUBLISH_WORKSPACE" = true ]; then cp .stroggforge/.github/scripts/publish_workspace.py "$RUNNER_TEMP/publish_workspace.py" rm -rf .stroggforge python3 "$RUNNER_TEMP/publish_workspace.py" exit 0 fi rm -rf .stroggforge for binary in $(jq -r '.[]' <<<"$BINARY_NAMES"); do if [ -n "$BINARY_PACKAGE" ] && [ "$BINARY_PACKAGE" != workspace ]; then cargo publish --package "$BINARY_PACKAGE" elif [ -d "$binary" ]; then cargo publish --manifest-path "$binary/Cargo.toml" else cargo publish fi done—

docs#

StepAction / commandCondition
—actions/checkout@v6—
—actions/checkout@v6—
—DreamWeave-MP/StroggForge/.github/actions/rust-setup@v72—
Build the documentationrm -rf target/doc cargo doc --no-deps --workspace bash .stroggforge/scripts/shared/docs-index.sh '${{ inputs.binary_names }}' target/doc/index.html—
—actions/configure-pages@v6.0.0—
—actions/upload-pages-artifact@v5.0.0—
Deploy to GitHub Pagesactions/deploy-pages@v5.0.0—

lint#

StepAction / commandCondition
—actions/checkout@v6—
—actions/checkout@v6—
—DreamWeave-MP/StroggForge/.github/actions/rust-setup@v72—
Check formattingcargo fmt --all --check—
Generate Cargo.lock for the auditif [ ! -f Cargo.lock ]; then cargo generate-lockfile fi—
—taiki-e/install-action@cargo-audit—
Audit dependencies against RustSeccargo audit—
Package each crate for crates.io (dry run)if [ "$PUBLISH_WORKSPACE" = true ]; then cargo publish --workspace --dry-run exit 0 fi for binary in $(jq -r '.[]' <<<"$BINARY_NAMES"); do if [ -n "$BINARY_PACKAGE" ] && [ "$BINARY_PACKAGE" != workspace ]; then cargo publish --dry-run --package "$BINARY_PACKAGE" elif [ -d "$binary" ]; then cargo publish --dry-run --manifest-path "$binary/Cargo.toml" else cargo publish --dry-run fi doneinputs.cargo_publish && github.ref_type != 'tag'
Resolve the MSRVbash .stroggforge/scripts/shared/resolve-msrv.sh "$MSRV_INPUT"inputs.msrv != ''
—DreamWeave-MP/StroggForge/.github/actions/rust-setup@v72inputs.msrv != ''
Check on the MSRVcargo "+$MSRV_TOOLCHAIN" check --workspace --all-features --all-targetsinputs.msrv != ''

mod-template#

StepAction / commandCondition

nexus#

StepAction / commandCondition
—actions/checkout@v6—
—actions/download-artifact@v8.0.1—
Read the uploadbash .stroggforge/scripts/corprus-crucible/read-nexusmods-upload-artifact.sh ".corprus-crucible/nexus-downloads/${{ matrix.upload }}"—
—Nexus-Mods/upload-action@v1.0.0-beta.5—

notify#

StepAction / commandCondition

publish#

StepAction / commandCondition
—actions/checkout@v6—
—actions/checkout@v6—
Download the release archivesactions/download-artifact@v8.0.1—
Package the muOS appsbash .stroggforge/scripts/corprus-crucible/package-muxapp.sh "$MUXAPP_DIR" .corprus-crucible/github-release-downloads .corprus-crucible/github-release-downloadsinputs.muxapp_dir != '' && inputs.enable_portmaster
Stage the muOS apps for the site's recordactions/upload-artifact@v7.0.1inputs.muxapp_dir != '' && inputs.enable_portmaster
Refresh the GitHub releaseecho "release_name=$RELEASE_NAME" >> "$GITHUB_OUTPUT" bash .stroggforge/scripts/shared/refresh-github-release.sh "$RELEASE_NAME" "$WORKFLOW_RUN_ID" "$RELEASE_REPOSITORY"—
Collect the VirusTotal linksbody_file=.corprus-crucible/github-release-downloads/release-body.md : > "$body_file" shopt -s nullglob for vt_file in .corprus-crucible/github-release-downloads/*.vt.md; do if [ -s "$vt_file" ]; then printf '%s\n' "$(< "$vt_file")" >> "$body_file" fi done echo "body_path=$body_file" >> "$GITHUB_OUTPUT"—
Upload the archives to the GitHub releasebash .stroggforge/scripts/shared/publish-github-release-artifacts.sh "$RELEASE_NAME" "$BODY_PATH" .corprus-crucible/github-release-downloads "$REPOSITORY"—
Generate and upload the changelogbash .stroggforge/scripts/shared/changelog.sh CHANGELOG.md gh release upload "$RELEASE_NAME" CHANGELOG.md --clobber --repo "$REPOSITORY"inputs.generate_changelog
Download the Nexus Mods uploadsactions/download-artifact@v8.0.1—
List the Nexus Mods uploadsshopt -s nullglob uploads=() for dir in .corprus-crucible/nexus-downloads/nexus-*; do uploads+=("$(basename "$dir")") done if [ ${#uploads[@]} -eq 0 ]; then echo "uploads=[]" >> "$GITHUB_OUTPUT" else echo "uploads=$(printf '%s\n' "${uploads[@]}" | jq -R . | jq -cs .)" >> "$GITHUB_OUTPUT" fi—
Open an issue in each dependent repositorybash .stroggforge/scripts/shared/create-dependent-update-issues.sh "$DEPENDENT_REPO_NAMES" "$AUR_PACKAGE_NAME"github.ref_type == 'tag' && inputs.dependent_repo_names != '' && inputs.dependent_repo_names != '[]'

release#

StepAction / commandCondition
—actions/checkout@v6—
—DreamWeave-MP/StroggForge/.github/actions/corprus-crucible@v72—

release-android#

StepAction / commandCondition
Install archive dependenciessudo apt-get update && sudo apt-get install -y p7zip-full—
—actions/checkout@v6—
Set up the Android NDKnttld/setup-ndk@v1—
Point Cargo at the NDKbin="$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" { echo "ANDROID_NDK_HOME=$NDK" echo "NDK_HOME=$NDK" echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=$bin/aarch64-linux-android${ANDROID_API_LEVEL}-clang" echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_AR=$bin/llvm-ar" echo "CC_aarch64_linux_android=$bin/aarch64-linux-android${ANDROID_API_LEVEL}-clang" echo "CXX_aarch64_linux_android=$bin/aarch64-linux-android${ANDROID_API_LEVEL}-clang++" echo "AR_aarch64_linux_android=$bin/llvm-ar" echo "CMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake" echo "ANDROID_ABI=arm64-v8a" echo "ANDROID_PLATFORM=android-${ANDROID_API_LEVEL}" echo "BINDGEN_EXTRA_CLANG_ARGS=--sysroot=$NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot" echo "PKG_CONFIG_ALLOW_CROSS=1" } >> "$GITHUB_ENV"—
—DreamWeave-MP/StroggForge/.github/actions/corprus-crucible@v72—

release-linux#

StepAction / commandCondition
—actions/checkout@v6—
—DreamWeave-MP/StroggForge/.github/actions/corprus-crucible@v72—

release-portmaster#

StepAction / commandCondition
—actions/checkout@v6—
—DreamWeave-MP/StroggForge/.github/actions/corprus-crucible@v72—

site-check#

StepAction / commandCondition

test#

StepAction / commandCondition
—actions/checkout@v6—
—actions/checkout@v6—
—DreamWeave-MP/StroggForge/.github/actions/rust-setup@v72—
Install a software GPUsudo apt-get update && sudo apt-get install -y mesa-vulkan-driversinputs.gpu_tests && runner.os == 'Linux'
Clippy with every featurecargo clippy --workspace --all-targets --all-features -- -W clippy::pedantic -D warnings—
Clippy with the features the release shipsbash .stroggforge/scripts/corprus-crucible/clippy-release.sh '${{ inputs.binary_names }}' '${{ inputs.binary_package }}' '${{ matrix.platform_os }}' '${{ matrix.platform_arch }}'—
Build the testscargo test --workspace --all-features --no-run --timings—
Run the testscargo test --workspace --all-features -- --show-output—
—actions/upload-artifact@v7always() && steps.build_tests.outcome != 'skipped'