Replace promu with GoReleaser to fix missing version info in Docker images#170
Merged
Replace promu with GoReleaser to fix missing version info in Docker images#170
Conversation
Switch from promu to GoReleaser to fix missing version info in Docker images (#167). The Dockerfile previously used plain `go build` without ldflags, so `--version` showed empty fields. Changes: - Add .goreleaser.yml with ldflags for version injection, multi-arch Docker image builds, and Docker manifests - Simplify Dockerfile to single stage (GoReleaser provides the binary) - Rewrite publish.yml to use goreleaser-action on tag push - Rewrite build.yml to validate builds with goreleaser --snapshot on PRs - Replace Makefile + Makefile.common with a simple Makefile - Remove .promu.yml and Makefile.common (no longer needed) https://claude.ai/code/session_012aF4Jp3RFW7zw5wYL1Wedv
Update to real release SHAs: - actions/setup-go v5.6.0 (40f1582b2485089dde7abd97c1529aa768e1baff) - goreleaser/goreleaser-action v6.4.0 (e435ccd777264be153ace6237001ef4d979d3a7a) https://claude.ai/code/session_012aF4Jp3RFW7zw5wYL1Wedv
Zizmor flags actions/setup-go's built-in cache as vulnerable to cache poisoning attacks. Disable it explicitly since GoReleaser manages its own build process. https://claude.ai/code/session_012aF4Jp3RFW7zw5wYL1Wedv
Chore commits often contain dependency bumps which are useful to surface in release changelogs for security-conscious users. https://claude.ai/code/session_012aF4Jp3RFW7zw5wYL1Wedv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--versionshowing empty fields in Docker images (--version output missing version string in v1.1.0 release #167).goreleaser.ymlwith ldflags for version injection, multi-arch Docker builds (amd64, arm64, armv7), and Docker manifestsbuild.ymlusesgoreleaser build --snapshotfor PR validation,publish.ymlusesgoreleaser releaseon tag pushMakefile+Makefile.common(283-line Prometheus boilerplate) with a simple 35-line Makefile.promu.ymlandMakefile.commonTest plan
goreleaser build --snapshot --cleansucceeds locally./dist/twitch_exporter_linux_amd64_v1/twitch_exporter --versionshows populated version fieldsmake build,make test,make lintwork with the new Makefile<ghcr.io/damoun/twitch-exporter>