personality
Clone
https://git.tahinli.com/Tahinli/personality.git
0 watching0 forksRustGPL-3.0460.1 KiB4de8815Tahinli7 days ago22 commits
| 1 | # CI for personality. Format: forge's docs/ci.md. |
| 2 | # |
| 3 | # The workflow has no branch condition, so the job also runs for pull requests. |
| 4 | # A tag push matching "v*" publishes a release with the binary and SHA256SUMS, only when the job succeeded. |
| 5 | |
| 6 | name = "build" |
| 7 | |
| 8 | [on] |
| 9 | push = ["main"] |
| 10 | pull_request = true |
| 11 | manual = true |
| 12 | tags = ["v*"] |
| 13 | |
| 14 | [jobs.build] |
| 15 | image = "docker.io/library/rust:1" |
| 16 | # CARGO_HOME in the workspace puts the downloaded crates in the cache, so a run downloads only new ones. |
| 17 | env = { CARGO_HOME = "/workspace/.cargo-home" } |
| 18 | # The groups are the job's steps on the run page, and `exec 2>&1` keeps a marker in order with cargo's |
| 19 | # stderr, which the runner reads from a separate pipe. |
| 20 | run = """ |
| 21 | exec 2>&1 |
| 22 | echo "::group::Release build" |
| 23 | cargo build --release |
| 24 | echo "::endgroup::" |
| 25 | echo "::group::Package" |
| 26 | ARCH=$(uname -m) |
| 27 | cp target/release/personality personality-$ARCH-linux |
| 28 | sha256sum personality-$ARCH-linux > SHA256SUMS |
| 29 | echo "::endgroup::" |
| 30 | """ |
| 31 | artifacts = ["personality-*-linux", "SHA256SUMS"] |
| 32 | cache = ["target", ".cargo-home"] |
| 33 | timeout_minutes = 60 |
| 34 | |
| 35 | [release] |
| 36 | assets = ["build:personality-*-linux", "build:SHA256SUMS"] |