Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goreleaser adding version to binaries #519

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rahulreddy15
Copy link
Contributor

https://goreleaser.com/customization/builds/go/

# GOAMD64 to build when GOARCH is amd64.
    # For more info refer to: https://pkg.go.dev/cmd/go#hdr-Environment_variables
    # and https://go.dev/wiki/MinimumRequirements#microarchitecture-support
    #
    # Default: [ 'v1' ].
    goamd64:
      - v2
      - v3

    # GOARM64 to build when GOARCH is arm64.
    # For more info refer to: https://pkg.go.dev/cmd/go#hdr-Environment_variables
    # and https://go.dev/wiki/MinimumRequirements#microarchitecture-support
    #
    # Default: [ 'v8.0' ].
    # Since: v2.4.
    goarm64:
      - v9.0

    # GOMIPS and GOMIPS64 to build when GOARCH is mips, mips64, mipsle or mips64le.
    # For more info refer to: https://pkg.go.dev/cmd/go#hdr-Environment_variables
    # and https://go.dev/wiki/MinimumRequirements#microarchitecture-support
    #
    # Default: [ 'hardfloat' ].
    # Since: v2.4.
    gomips:
      - hardfloat
      - softfloat

    # GO386 to build when GOARCH is 386.
    # For more info refer to: https://pkg.go.dev/cmd/go#hdr-Environment_variables
    # and https://go.dev/wiki/MinimumRequirements#microarchitecture-support
    #
    # Default: [ 'sse2' ].
    # Since: v2.4.
    go386:
      - sse2
      - softfloat

@rahulreddy15 rahulreddy15 requested a review from a team as a code owner February 7, 2025 08:45
@@ -63,7 +63,7 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
run: |
TAG=test GOOS=linux GOARCH=amd64 make ci/build
sudo cp ./dist/nri-prometheus-nix_linux_amd64/nri-prometheus ./bin/nri-prometheus
sudo cp ./dist/nri-prometheus-nix_linux_amd64_v1/nri-prometheus ./bin/nri-prometheus
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like it hardcoded here. It's very easy to miss. What if we move to version 2 or 3 for amd64, it will again fail and will need to be fixed.
Maybe it is better to use something like:
ls -t nri-prometheus-nix_linux_amd64* | head -n1
to decide the folder to use, and then copy file from there.

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.

2 participants