Skilllibrary release-binaries
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/10-cli-systems-and-ops/release-binaries" ~/.claude/skills/merceralex397-collab-skilllibrary-release-binaries && rm -rf "$T"
manifest:
10-cli-systems-and-ops/release-binaries/SKILL.mdsource content
Purpose
Cross-compile binaries for multiple OS/arch targets and automate release publishing with GoReleaser or cargo-dist.
When to use this skill
- setting up cross-compilation for Go (
/GOOS
) or Rust (GOARCH
)--target - configuring GoReleaser for automated GitHub releases
- stripping symbols, compressing binaries, or embedding version info
- publishing release artifacts with checksums and signatures
Do not use this skill when
- packaging into Homebrew/deb/rpm — prefer
packaging-installers - building Docker images — different workflow
- the project is a library, not a binary
Procedure
- Define target matrix —
,linux/amd64
,linux/arm64
,darwin/amd64
,darwin/arm64
.windows/amd64 - Configure GoReleaser — create
with.goreleaser.yaml
,builds
,archives
,checksum
.release - Set ldflags —
.-ldflags "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}" - Local build —
. Check output ingoreleaser build --snapshot --clean
.dist/ - CI workflow — GitHub Actions on
usingtags: v*
.goreleaser/goreleaser-action@v5 - Checksums — GoReleaser auto-generates. Manual:
.sha256sum dist/* > checksums.txt - Sign —
or GPG on checksums file.cosign sign-blob - Verify — download each artifact, check checksum, run
.--version
GoReleaser config
version: 2 builds: - env: [CGO_ENABLED=0] goos: [linux, darwin, windows] goarch: [amd64, arm64] ldflags: [-s, -w, "-X main.version={{.Version}}"] archives: - format_overrides: - goos: windows format: zip checksum: name_template: checksums.txt
Rust cross-compilation
rustup target add x86_64-unknown-linux-musl aarch64-unknown-linux-musl cargo build --release --target x86_64-unknown-linux-musl strip target/x86_64-unknown-linux-musl/release/mytool
Decision rules
for Go static binaries — avoids glibc issues.CGO_ENABLED=0- musl target for Rust static binaries on Linux.
- Always include
checksums.sha256
(Go) or-s -w
(Rust) reduces binary size ~30%.strip- Tag as
(semver withv1.2.3
prefix) — GoReleaser expects this.v
References
Related skills
— Homebrew/deb/rpm packagingpackaging-installers
— building the Go CLIcli-development-go
— command structure for the binarycobra-go