feat: release process with install script, version flag, and musl builds#22
feat: release process with install script, version flag, and musl builds#22Miyamura80 wants to merge 6 commits intomasterfrom
Conversation
… builds - Add build.rs to embed git SHA in --version output (e.g. "desktest 0.2.0 (abc1234)") - Add install.sh with platform detection, checksum verification, version pinning (DESKTEST_VERSION=x.y.z), and musl preference on Linux - Add musl targets (x86_64/aarch64) to release workflow for Alpine compatibility - Add check-version job to verify git tag matches Cargo.toml version - Add make bump_version VERSION=x.y.z for streamlined releases Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR introduces a full release pipeline: a Key findings:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["curl install.sh | sh"] --> B[detect_platform]
B --> C{OS?}
C -- Linux --> D["TARGET = ARCH-unknown-linux-musl ⚠️"]
C -- Darwin --> E[TARGET = ARCH-apple-darwin]
C -- Other --> F[err: Unsupported OS]
D --> G[resolve_version]
E --> G
G --> H{DESKTEST_VERSION set?}
H -- Yes --> I["VERSION = v$DESKTEST_VERSION"]
H -- No --> J[curl GitHub API for latest tag]
J --> K{VERSION empty?}
K -- Yes --> L[err: Failed to fetch]
K -- No --> M[download_and_install]
I --> M
M --> N[Download tarball + SHA256SUMS.txt]
N --> O[Verify checksum]
O --> P{INSTALL_DIR writable?}
P -- Yes --> Q[mkdir + mv + chmod +x]
P -- No --> R[sudo mkdir + mv + chmod +x]
Q --> S[verify_installation]
R --> S
S --> T{desktest in PATH?}
T -- Yes --> U[log desktest --version]
T -- No --> V{INSTALL_DIR in PATH?}
V -- Yes --> W[log installed path]
V -- No --> X[warn: add to PATH]
|
- Fix silent empty VERSION when GitHub API fails (add explicit empty check) - Rename TMPDIR to DL_TMPDIR to avoid shadowing POSIX env var - Use %b format specifier in printf helpers for proper \n handling - Use real newlines instead of \n escapes in multi-line error messages - Pin musl.cc download with SHA256 checksum verification - Fix install dir writability check to test parent dir when target doesn't exist - Abort version bump on cargo check failure instead of silently continuing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move chmod +x inside the sudo/non-sudo branches so it doesn't fail on root-owned binaries with set -eu - Add .git/packed-refs to rerun-if-changed so the embedded SHA stays fresh after git gc or in cloned repos with packed refs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ld releases
- Change test skip from !contains('aarch64') to !contains('aarch64-unknown-linux')
so aarch64-apple-darwin (native on Apple Silicon) still runs tests
- Add gnu fallback in install.sh when musl tarball is not found, supporting
pinned installs of pre-musl releases
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Package step used `&>/dev/null` which is a bash extension. Replace with `>/dev/null 2>&1` for POSIX compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
--versionflag: Outputs version + git SHA (e.g.desktest 0.2.0 (abc1234)) viabuild.rscompile-time embeddingcurl -fsSL .../install.sh | shwith platform detection, SHA256 checksum verification,DESKTEST_VERSIONpinning, musl preference on Linux, andDESKTEST_INSTALL_DIRoverridex86_64-unknown-linux-muslandaarch64-unknown-linux-musltargets to release workflow (6 total) for Alpine/minimal Docker image compatibilitycheck-versionCI job blocks release if git tag doesn't matchCargo.tomlmake bump_version VERSION=x.y.z: Updates Cargo.toml, commits, and tags in one commandInstall usage
Test plan
cargo test— 377 passed, 0 faileddesktest --versionoutputsdesktest 0.2.0 (77b5fa3)🤖 Generated with Claude Code