Skip to content

Commit

Permalink
GoReleaser: split ldflags into list items
Browse files Browse the repository at this point in the history
  • Loading branch information
talal committed Jun 16, 2022
1 parent acf3b72 commit f7a40cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down

0 comments on commit f7a40cf

Please sign in to comment.