From f7a40cfe44447bddb01be547c420a57e48f54803 Mon Sep 17 00:00:00 2001 From: Muhammad Talal Anwar Date: Thu, 16 Jun 2022 20:34:32 +0200 Subject: [PATCH] GoReleaser: split ldflags into list items --- .goreleaser.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 5f5bf11e..48bacc6b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,8 +8,14 @@ builds: goarch: - amd64 ldflags: - - -s -w -X github.com/sapcc/go-api-declarations/bininfo.binName=ntp_exporter -X github.com/sapcc/go-api-declarations/bininfo.version={{ .Version }} -X github.com/sapcc/go-api-declarations/bininfo.commit={{ .FullCommit }} -X github.com/sapcc/go-api-declarations/bininfo.buildDate={{ .CommitDate }} - mod_timestamp: '{{ .CommitTimestamp }}' # Ensure builds are reproducible + - -s -w + - -X github.com/sapcc/go-api-declarations/bininfo.binName=ntp_exporter + - -X github.com/sapcc/go-api-declarations/bininfo.version={{ .Version }} + - -X github.com/sapcc/go-api-declarations/bininfo.commit={{ .FullCommit }} + # Use CommitDate instead of Date for reproducibility. + - -X github.com/sapcc/go-api-declarations/bininfo.buildDate={{ .CommitDate }} + # Set the modified timestamp on the output binary to ensure that builds are reproducible. + mod_timestamp: "{{ .CommitTimestamp }}" archives: - name_template: '{{ .ProjectName }}-{{ replace .Version "v" "" }}-{{ .Os }}-{{ .Arch }}'