diff --git a/.goreleaser.yml b/.goreleaser.yml index a3972075..97e435f6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,7 +7,8 @@ before: - go mod download builds: - - &COMMON + - &BUILD + id: default env: - CGO_ENABLED=0 main: ./cmd/step/main.go @@ -15,9 +16,9 @@ builds: - -trimpath ldflags: - -w -X main.Version={{.Version}} -X main.BuildTime={{.Date}} - - - << : *COMMON - id: default + gcflags: + - >- + {{- if ne (index .Env "DEBUG") "" }}all=-N -l{{- end }} targets: - darwin_amd64 - darwin_arm64 @@ -34,13 +35,9 @@ builds: - windows_amd64 - windows_arm64 binary: bin/step - - - << : *COMMON - id: debug - gcflags: all=-N -l - # This build is for S3 binaries that follow our naming convention there. - << : *COMMON + << : *BUILD id: s3-versioned targets: - darwin_amd64 @@ -52,7 +49,7 @@ builds: binary: 'step_{{ .Version }}_{{ .Os }}_{{ .Arch }}' - # This build is for S3 unversioned binaries that follow our naming convention there. - << : *COMMON + << : *BUILD id: s3-unversioned targets: - darwin_amd64 @@ -67,7 +64,7 @@ builds: # It's exactly the same as the default build above, except: # - it only builds the archs we want to produce .deb and .rpm files for # - the name of the output binary is step-cli - << : *COMMON + << : *BUILD id: nfpm goos: - linux @@ -78,6 +75,7 @@ builds: archives: - &ARCHIVE + id: default # Can be used to change the archive formats for specific GOOSs. # Most common use case is to archive as zip on Windows. # Default is empty. diff --git a/Makefile b/Makefile index f9c2cec0..96a20069 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,6 @@ CGO_OVERRIDE?=CGO_ENABLED=0 # which build id in .goreleaser.yml to build GORELEASER_BUILD_ID?=default -ifdef DEBUG - GORELEASER_BUILD_ID=debug -endif all: lint test build @@ -120,7 +117,7 @@ $(PREFIX)/$(BINNAME): goreleaser: $Q mkdir -p $(PREFIX) - $Q $(GOOS_OVERRIDE) $(CGO_OVERRIDE) goreleaser build \ + $Q $(GOOS_OVERRIDE) $(CGO_OVERRIDE) DEBUG=$(DEBUG) goreleaser build \ --id $(GORELEASER_BUILD_ID) \ --snapshot \ --single-target \