Corprus Crucible

.github/actions/corprus-crucible/action.yml

Source: .github/actions/corprus-crucible/action.yml · composite action

Build a release binary, sign it, archive it, scan it and stage publication artifacts.

Intended for: Platform build jobs in rustGlobalBuild; this action does not run tests. With lint it runs Clippy on the build as released first, for targets no test job compiles.

Release behavior#

Non-PR: validate token, build, check the binary needs nothing of the build machine, keyless Cosign sign binary, create zip, scan, stage. PR: build, check, and upload a workflow artifact. Final GitHub/Nexus publishing belongs to later workflow jobs.

Artifacts and effects#

  • Release binary
  • Cosign bundle included with the zip
  • Staged GitHub/Nexus workflow artifacts

Assumptions and permissions#

  • Quality checks run in the reusable workflow alongside this action; nothing it stages is published unless they pass.
  • contents/id-token write are needed by release jobs; vt_api_key is required outside PRs.
  • Platform overrides select archive names/target; cargo_package controls root-workspace selection. Pull requests restore the default branch's caches.

Failure modes#

  • Build context/manifest confusion: inspect resolve-build-context.sh and build-release-binary.sh.
  • Missing include_files or archiver: inspect create-release-archive.sh.
  • OIDC/signing or scan failures: inspect sign-release-binary.sh and format-virustotal-links.sh.

Example#

Use rustGlobalBuild rather than bypassing its quality gates. The action's inputs and ordered steps are generated below.

Inputs#

NameTypeRequiredDefaultDescription
binary_name—true—Name of the binary (without platform suffix)
cargo_package—falseOptional Cargo package that provides the binary, built from the repository root with --package <name> --bin <binary_name>. workspace builds with --workspace --bin <binary_name> instead. Empty keeps directory detection.
development_release—falsedevelopmentThe rolling pre-release default-branch pushes refresh: release_name is a development build when it is this.
include_files—falseREADME.md,LICENSEAdditional files or directories to include in archives (comma-separated)
lint—falsefalseRun Clippy on the build as released (its target and features) before building. For targets no test job compiles, such as Android and PortMaster.
nexus_api_key—falseNexus Mods API key. Provide with nexus_group_ids to upload release archives to Nexus Mods.
nexus_group_ids—falseNexus Mods file group IDs as JSON. Provide with nexus_api_key to upload release archives to Nexus Mods.
platform_arch—falseRelease platform architecture used for artifacts. Defaults to the runner architecture for native builds.
platform_os—falseRelease platform name used for artifacts. Defaults to the runner OS for native builds.
release_name—true—Name of the release (tag or development)
rust_target—falseOptional Rust target triple for cross-compiled release builds.
vt_api_key—true—VirusTotal API key (REQUIRED)

Permissions#

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

Steps#

Composite action#

StepAction / commandCondition
Validate VirusTotal API Keybash "${{ github.action_path }}/../../../scripts/corprus-crucible/validate-virustotal-key.sh" "${{ inputs.vt_api_key }}"github.event_name != 'pull_request'
Determine Binary Suffixbash "${{ github.action_path }}/../../../scripts/corprus-crucible/binary-suffix.sh" "${{ inputs.platform_os || runner.os }}"—
Determine Build Contextbash "${{ github.action_path }}/../../../scripts/corprus-crucible/resolve-build-context.sh" "${{ inputs.binary_name }}" "${{ inputs.cargo_package }}"—
Setup Rustdtolnay/rust-toolchain@stable—
Setup LLVMbash "${{ github.action_path }}/../../../scripts/shared/setup-llvm.sh" "" ""—
Name the target cache's partitionbash "${{ github.action_path }}/../../../scripts/shared/cache-partition.sh"—
Setup Rust Targetrustup target add "${{ inputs.rust_target }}"inputs.rust_target != ''
⚡ Cache the downloaded cratesactions/cache@v5.0.5github.event_name != 'pull_request'
⚡ Restore the downloaded cratesactions/cache/restore@v5.0.5github.event_name == 'pull_request'
⚡ Restore Cargo target cacheactions/cache/restore@v5.0.5—
Lint the build as releasedbash "${{ github.action_path }}/../../../scripts/corprus-crucible/clippy-release.sh" '["${{ inputs.binary_name }}"]' "${{ inputs.cargo_package }}" "${{ inputs.platform_os || runner.os }}" "${{ inputs.platform_arch || runner.arch }}" "${{ inputs.rust_target }}" "${{ steps.context.outputs.target_dir }}"inputs.lint == 'true'
Build Releasebash "${{ github.action_path }}/../../../scripts/corprus-crucible/build-release-binary.sh" "${{ inputs.binary_name }}" "${{ steps.os_check.outputs.suffix }}" "${{ steps.context.outputs.build_dir }}" "${{ steps.context.outputs.target_dir }}" "${{ steps.context.outputs.dist_dir }}" "${{ inputs.rust_target }}" "${{ inputs.platform_os || runner.os }}" "${{ inputs.platform_arch || runner.arch }}" "${{ inputs.cargo_package }}"—
Check the binary needs nothing of the build machinebash "${{ github.action_path }}/../../../scripts/corprus-crucible/check-release-binary.sh" "${{ steps.build_release.outputs.release_binary }}" "${{ inputs.platform_os || runner.os }}"—
⚡ Save Cargo target cacheactions/cache/save@v5.0.5github.event_name != 'pull_request' && steps.cache_release_target.outputs.cache-hit != 'true'
Install Cosignsigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6adgithub.event_name != 'pull_request'
Sign Binarybash "${{ github.action_path }}/../../../scripts/corprus-crucible/sign-release-binary.sh" "${{ steps.build_release.outputs.release_binary }}" "${{ steps.context.outputs.dist_dir }}/${{ inputs.binary_name }}-${{ inputs.platform_os || runner.os }}-${{ inputs.platform_arch || runner.arch }}.bundle"github.event_name != 'pull_request'
Create Archivebash "${{ github.action_path }}/../../../scripts/corprus-crucible/create-release-archive.sh" "${{ inputs.binary_name }}" "${{ inputs.platform_os || runner.os }}" "${{ inputs.platform_arch || runner.arch }}" "${{ steps.build_release.outputs.binary_name }}" "${{ steps.context.outputs.build_dir }}" "${{ steps.context.outputs.dist_dir }}" "${{ inputs.include_files }}"github.event_name != 'pull_request'
VirusTotal Scancrazy-max/ghaction-virustotal@v5github.event_name != 'pull_request'
Format VirusTotal Linksbash "${{ github.action_path }}/../../../scripts/corprus-crucible/format-virustotal-links.sh" "${{ inputs.binary_name }}-${{ inputs.platform_os || runner.os }}-${{ inputs.platform_arch || runner.arch }}" "${{ steps.vt_scan.outputs.analysis }}"github.event_name != 'pull_request'
Validate Nexus Mods Inputsbash "${{ github.action_path }}/../../../scripts/corprus-crucible/validate-nexusmods-inputs.sh" "${{ inputs.nexus_api_key }}"github.event_name != 'pull_request' && (inputs.nexus_api_key != '' || inputs.nexus_group_ids != '')
Resolve Nexus Mods Group IDbash "${{ github.action_path }}/../../../scripts/corprus-crucible/resolve-nexusmods-group-id.sh" "$PLATFORM_OS" "$PLATFORM_ARCH" "$RELEASE_NAME"github.event_name != 'pull_request' && inputs.nexus_api_key != '' && inputs.nexus_group_ids != ''
Prepare Nexus Mods Archivebash "${{ github.action_path }}/../../../scripts/corprus-crucible/prepare-nexusmods-archive.sh" "$BINARY_NAME" "$PLATFORM_OS" "$PLATFORM_ARCH" "$NEXUS_PLATFORM" "$RELEASE_NAME"github.event_name != 'pull_request' && inputs.nexus_api_key != '' && steps.nexus_group.outputs.group_id != ''
Prepare Nexus Mods Upload Artifactbash "${{ github.action_path }}/../../../scripts/corprus-crucible/prepare-nexusmods-upload-artifact.sh" "$BINARY_NAME" "$PLATFORM_OS" "$PLATFORM_ARCH" "$NEXUS_GROUP_ID" "$NEXUS_ARCHIVE" "$NEXUS_FILE_STEM" "$RELEASE_NAME" "$REPOSITORY"github.event_name != 'pull_request' && inputs.nexus_api_key != '' && steps.nexus_group.outputs.group_id != ''
Upload Nexus Mods Upload Artifactactions/upload-artifact@v7.0.1github.event_name != 'pull_request' && inputs.nexus_api_key != '' && steps.nexus_group.outputs.group_id != ''
Prepare GitHub Release Artifactbash "${{ github.action_path }}/../../../scripts/corprus-crucible/prepare-github-release-artifact.sh" "${{ inputs.binary_name }}" "${{ inputs.platform_os || runner.os }}" "${{ inputs.platform_arch || runner.arch }}" "${{ inputs.binary_name }}-${{ inputs.platform_os || runner.os }}-${{ inputs.platform_arch || runner.arch }}.zip"github.event_name != 'pull_request'
Upload GitHub Release Artifactactions/upload-artifact@v7.0.1github.event_name != 'pull_request'
Upload artifact (for PRs)actions/upload-artifact@v7.0.1github.event_name == 'pull_request'