Skip to content

Commit

Permalink
Ensuring build/version numbers in goreleaser build
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Lhussiez committed Oct 23, 2018
1 parent 2ec76b6 commit 2297d87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
builds:
- env:
- CGO_ENABLED=0
goos: [linux]
goarch: [amd64, arm, arm64, 386]
- goarch: [amd64, arm, arm64, 386]
goarm: [6, 7]
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X "main.Version={{.Env.VERSION}}" -X "main.Build={{ .Env.BUILD }}"
archive:
wrap_in_directory: true
format: tar.gz
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ help:
build: ## Build
CGO_ENABLED=0 go build -o $(BINARY) $(LDFLAGS)

.PHONY: release
release: ## Create a new release on Github
VERSION=$(VERSION) BUILD=$(BUILD) goreleaser --snapshot

.PHONY: test
test: ## Run the test suite
go test ./...
Expand Down

0 comments on commit 2297d87

Please sign in to comment.