# CI for personality. Format: forge's docs/ci.md. # # The workflow has no branch condition, so the job also runs for pull requests. # A tag push matching "v*" publishes a release with the binary and SHA256SUMS, only when the job succeeded. name = "build" [on] push = ["main"] pull_request = true manual = true tags = ["v*"] [jobs.build] image = "docker.io/library/rust:1" # CARGO_HOME in the workspace puts the downloaded crates in the cache, so a run downloads only new ones. env = { CARGO_HOME = "/workspace/.cargo-home" } # The groups are the job's steps on the run page, and `exec 2>&1` keeps a marker in order with cargo's # stderr, which the runner reads from a separate pipe. run = """ exec 2>&1 echo "::group::Release build" cargo build --release echo "::endgroup::" echo "::group::Package" ARCH=$(uname -m) cp target/release/personality personality-$ARCH-linux sha256sum personality-$ARCH-linux > SHA256SUMS echo "::endgroup::" """ artifacts = ["personality-*-linux", "SHA256SUMS"] cache = ["target", ".cargo-home"] timeout_minutes = 60 [release] assets = ["build:personality-*-linux", "build:SHA256SUMS"]