Skip to content

build: inject release version into binaries via goreleaser#99

Merged
arran4 merged 3 commits intomasterfrom
fix-goreleaser-version-injection-4246077277579118436
Apr 17, 2026
Merged

build: inject release version into binaries via goreleaser#99
arran4 merged 3 commits intomasterfrom
fix-goreleaser-version-injection-4246077277579118436

Conversation

@arran4
Copy link
Copy Markdown
Owner

@arran4 arran4 commented Apr 17, 2026

Added ldflags with -X github.com/arran4/gocdm/cli.Version={{.Version}} to both the gocdm and gocdm-nopam build definitions in .goreleaser.yaml to ensure the correct version is injected during the build process, replacing the default "dev".


PR created automatically by Jules for task 4246077277579118436 started by @arran4

Updated `.goreleaser.yaml` to include `ldflags` that inject the release version `{{.Version}}` into `github.com/arran4/gocdm/cli.Version`. This ensures `gocdm --version` reports the actual version instead of the default "dev" string.

Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the .goreleaser.yaml configuration to include ldflags for both the gocdm and gocdm-nopam builds, which sets the version string and strips debug symbols. The review feedback suggests using YAML anchors to avoid duplicating the ldflags definition and recommends splitting the flags into separate list items to improve readability and maintainability.

Comment thread .goreleaser.yaml Outdated
Comment thread .goreleaser.yaml Outdated
Refactored `.goreleaser.yaml` to use a YAML anchor (`&common-ldflags`) for the `ldflags` list, avoiding duplication between the `gocdm` and `gocdm-nopam` builds. Split the flags (`-s`, `-w`, `-X ...`) into separate list items for better readability and to follow idiomatic GoReleaser configurations.

Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
Comment thread .goreleaser.yaml.orig Outdated
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jules unnecesary file

Comment thread .goreleaser.yaml
ldflags: &common-ldflags
- -s
- -w
- -X github.com/arran4/gocdm/cli.Version={{.Version}}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jules isn't this redundant now?

Refactored `.goreleaser.yaml` to use a YAML anchor (`&common-ldflags`) for the `ldflags` list, avoiding duplication between the `gocdm` and `gocdm-nopam` builds. Split the flags (`-s`, `-w`, `-X ...`) into separate list items for better readability and to follow idiomatic GoReleaser configurations.

Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
@arran4 arran4 merged commit d5420d6 into master Apr 17, 2026
6 checks passed
@arran4 arran4 deleted the fix-goreleaser-version-injection-4246077277579118436 branch April 17, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant