Skip to content

Commit

Permalink
Merge pull request #1245 from smallstep/carl/goreleaser-fix-build
Browse files Browse the repository at this point in the history
Remove extra builds and fix debug option
  • Loading branch information
tashian authored Jul 23, 2024
2 parents 07a000e + 6ee0630 commit 28c568e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
20 changes: 9 additions & 11 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ before:
- go mod download

builds:
- &COMMON
- &BUILD
id: default
env:
- CGO_ENABLED=0
main: ./cmd/step/main.go
flags:
- -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 28c568e

Please sign in to comment.