Logo: Go Build Release

Go Build Release

Communautéit
eduardo-sl
go-build-release

Build and release Go binaries that are reproducible and verifiable: version stamping, -trimpath builds, cross-compilation, GoReleaser, checksums, SBOMs, cosign signing, build provenance attestations, and container images with ko or a multi-stage Dockerfile. Use when: "release a Go binary", "set up GoReleaser", "cross-compile", "reproducible build", "sign the release", "generate an SBOM", "build provenance", "publish a container image", "version command shows (devel)". Not for: test and lint pipelines (go-ci), shrinking the binary or image (go-binary-size), auditing dependencies (go-dependency-audit).

Iwwersiicht

Editeureduardo-sl
Repositorygo-agent-skills
Skill-Nummgo-build-release
Stären
86
Forks
11
Matgeliwwert Dateien
2
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    eduardo-sl huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Go Build Release an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(workflow)/go-build-release
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.

An TypingMind benotzen

Aktivéiert Go Build Release an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Go Build Release automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Go Build Release net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Go Build and Release

A release is a promise that the binary users run is the one your source and pipeline produced. Make it reproducible so anyone can rebuild it, and verifiable so anyone can check it — before automating the publishing.

Detailed reference material, loaded on demand:

  • references/goreleaser.md — a complete .goreleaser.yaml and the tag-triggered release workflow.
  • references/supply-chain.md — SBOMs, cosign signing and verification, provenance attestations, signing container images.

Read a reference file only when the summary below is not enough.

1. Version Stamping

go
// Go 1.24+: built from a git checkout, Main.Version is the tag (v1.4.0)
// or a pseudo-version; vcs.* settings carry the commit and dirty flag.
info, _ := debug.ReadBuildInfo()
fmt.Println(info.Main.Version, info.GoVersion)
bash
go version -m ./bin/api          # inspect what a binary was built from
  • Prefer build info: it needs no flags and cannot drift from the source.
  • When a release tool builds from an archive without .git, inject the values: -ldflags "-X main.version=v1.4.0 -X main.commit=$SHA".
  • Never stamp the wall-clock build time — it makes every build unique. Use the commit time if you need a date.

2. Reproducible Builds

The same source, toolchain and flags must give byte-identical binaries:

bash
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/api ./cmd/api
sha256sum bin/api   # rebuild in a clean checkout and compare
  • -trimpath removes your machine's paths from the binary.
  • Pin the toolchain: the go and toolchain lines in go.mod, the same image or setup-go version in CI. Go's own toolchain is reproducible since 1.21.
  • CGO_ENABLED=0 unless you need cgo — a C toolchain is one more input that varies between machines.
  • go mod download and go mod verify before building, so a tampered module cache fails the build.

3. Cross-Compilation

bash
go tool dist list                                  # every GOOS/GOARCH pair
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -o bin/api-linux-arm64 ./cmd/api
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -o bin/api.exe ./cmd/api

Pure Go cross-compiles from any host. With cgo you need a C cross-compiler per target; prefer pure-Go dependencies (e.g. a pure-Go SQLite driver) when you ship to several platforms. Raise GOAMD64 (v2/v3) only when every target CPU supports it — the binary will not start on older ones.

4. Release Automation with GoReleaser

One config builds every target, archives, checksums, SBOMs and signs:

yaml
# .goreleaser.yaml (excerpt — full file in references/goreleaser.md)
version: 2
builds:
  - main: ./cmd/api
    env: [CGO_ENABLED=0]
    flags: [-trimpath]
    ldflags: ["-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"]
    mod_timestamp: "{{ .CommitTimestamp }}" # reproducible file times
    goos: [linux, darwin, windows]
    goarch: [amd64, arm64]
checksum:
  name_template: checksums.txt
bash
goreleaser check                         # validate the config
goreleaser release --snapshot --clean    # full dry run, nothing published

Release on tag push (v1.4.0) from CI, never from a laptop: the pipeline is the only place whose inputs are recorded.

5. Supply-Chain Artifacts

ArtifactAnswersProduced by
checksums.txtDid my download arrive intact?GoReleaser checksum
SBOM (SPDX or CycloneDX)What is inside this binary?syft, GoReleaser sboms
Signature bundle (.sigstore.json)Did this project's pipeline publish it?cosign sign-blob --bundle, keyless in CI
Provenance attestationWhich workflow, commit and runner built it?actions/attest (SLSA provenance)

Sign the checksums file rather than every archive — one signature then covers them all. Keyless signing uses the CI job's OIDC identity, so there is no private key to leak or rotate. Publish the exact verification commands in the release notes; a signature nobody verifies protects nobody. Commands: references/supply-chain.md.

6. Container Images

  • Pure-Go services: ko. Builds from the Go source without a Dockerfile, on a distroless base, multi-arch, with an SBOM, reproducibly: KO_DOCKER_REPO=ghcr.io/acme ko build --bare --platform=linux/amd64,linux/arm64 ./cmd/api.
  • Otherwise a multi-stage Dockerfile: build in golang:<version>, copy the binary into gcr.io/distroless/static:nonroot, run as non-root.
  • Reference images by digest in deployments, and sign them with cosign.
  • Image size is owned by the go-binary-size skill.

7. Versioning

  • Tags are semver with a v prefix: v1.4.0. Never move or delete a published tag — the module proxy has cached it, and users' go.sum pins its hash.
  • A breaking change to a library is a new major version with a /v2 module path, not just a v2.0.0 tag.
  • A bad release is withdrawn with retract in go.mod (the go-dependency-audit skill), then fixed in a new patch release.
  • Generate release notes from Conventional Commits (git-commit skill); GoReleaser's changelog.groups sorts them into features and fixes.

Verification Checklist

  1. go version -m on the release binary shows the tag and commit
  2. Two clean builds of the same tag produce identical SHA-256 sums
  3. -trimpath, CGO_ENABLED=0 (or a justified cgo build), pinned toolchain
  4. No build timestamps; file times derived from the commit
  5. Releases come from a tag-triggered CI job, never a laptop
  6. checksums.txt is signed; SBOMs are published; provenance is attested
  7. Release notes include the cosign verify-blob / gh attestation verify commands
  8. Images built with ko or multi-stage on distroless, non-root, referenced by digest
  9. Published tags are never moved; bad releases are retracted

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Go Build Release?

Build and release Go binaries that are reproducible and verifiable: version stamping, -trimpath builds, cross-compilation, GoReleaser, checksums, SBOMs, cosign signing, build provenance attestations, and container images with ko or a multi-stage Dockerfile. Use when: "release a Go binary", "set up GoReleaser", "cross-compile", "reproducible build", "sign the release", "generate an SBOM", "build provenance", "publish a container image", "version command shows (devel)". Not for: test and lint pipelines (go-ci), shrinking the binary or image (go-binary-size), auditing dependencies (go-dependen...

Firwat Go Build Release op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Go Build Release besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Go Build Release an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(workflow)/go-build-release an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Go Build Release benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Go Build Release benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Go Build Release domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Go Build Release gratis?

Jo. eduardo-sl huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇