Skip to content

Commit

Permalink
use goreleaser conditionals properly (#422)
Browse files Browse the repository at this point in the history
* use goreleaser conditionals properly

* fix goreleaser config: use inert -v flag to avoid empty flags value

* I missed a couple somehow. fixed
  • Loading branch information
stephengaudet authored Aug 3, 2023
1 parent 8469114 commit b03183a
Showing 1 changed file with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ builds:
- CGO_ENABLED=1
- CC=gcc
- CXX=g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -16,15 +17,16 @@ builds:
goarch:
- amd64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-cli-linux-amd
binary: signatory-cli
env:
- CGO_ENABLED=1
- CC=gcc
- CXX=g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory-cli/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -34,15 +36,16 @@ builds:
goarch:
- amd64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-linux-arm64
binary: signatory
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -52,15 +55,16 @@ builds:
goarch:
- arm64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-cli-linux-arm64
binary: signatory-cli
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory-cli/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -70,15 +74,16 @@ builds:
goarch:
- arm64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-linux-arm
binary: signatory
env:
- CGO_ENABLED=1
- CC=arm-linux-gnueabihf-gcc
- CXX=arm-linux-gnueabihf-g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -91,15 +96,16 @@ builds:
- '6'
- '7'
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-cli-linux-arm
binary: signatory-cli
env:
- CGO_ENABLED=1
- CC=arm-linux-gnueabihf-gcc
- CXX=arm-linux-gnueabihf-g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory-cli/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -112,7 +118,7 @@ builds:
- '6'
- '7'
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

# MACOS
- id: signatory-darwin-amd
Expand All @@ -121,7 +127,8 @@ builds:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -131,15 +138,16 @@ builds:
goarch:
- amd64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-cli-darwing-amd
binary: signatory-cli
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory-cli/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -149,15 +157,16 @@ builds:
goarch:
- amd64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-darwin-arm
binary: signatory
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -167,15 +176,16 @@ builds:
goarch:
- arm64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-cli-darwing-arm
binary: signatory-cli
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory-cli/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -185,7 +195,7 @@ builds:
goarch:
- arm64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

# WINDOWS
- id: signatory-windows-amd
Expand All @@ -194,7 +204,8 @@ builds:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -204,15 +215,16 @@ builds:
goarch:
- amd64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

- id: signatory-cli-windows-amd
binary: signatory-cli
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
- '{{ if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{ end }}'
- >-
{{- if .IsSnapshot }}GOEXPERIMENT=coverageredesign{{- end }}
main: ./cmd/signatory-cli/main.go
ldflags:
- '-X github.com/ecadlabs/signatory/pkg/metrics.GitRevision={{.Version}}'
Expand All @@ -222,7 +234,7 @@ builds:
goarch:
- amd64
flags:
- '{{ if .IsSnapshot }}-cover{{ end }}'
- '{{ if .IsSnapshot }}-cover{{ else }}-v{{ end }}'

dockers:
- ids:
Expand Down

0 comments on commit b03183a

Please sign in to comment.