3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

Merge pull request #1037 from slingamn/githash.2

fix #1031
This commit is contained in:
Shivaram Lingamneni 2020-05-20 08:00:59 -07:00 committed by GitHub
commit 5f4479e10b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 22 deletions

View File

@ -30,13 +30,18 @@ builds:
goarch: arm64 goarch: arm64
flags: flags:
- -trimpath - -trimpath
archive: # #1031: don't include the git hash in an official build
# default is: "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser"
ldflags:
- "-s -w -X main.build={{.Version}}"
archives:
-
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: tar.gz format: tar.gz
replacements: replacements:
386: i386 amd64: x86_64
amd64: x64 darwin: macos
darwin: osx
format_overrides: format_overrides:
- goos: windows - goos: windows
format: zip format: zip

View File

@ -1,14 +1,16 @@
.PHONY: all install build release capdefs test smoke .PHONY: all install build release capdefs test smoke
GIT_COMMIT := $(shell git rev-parse --short=16 HEAD 2> /dev/null)
capdef_file = ./irc/caps/defs.go capdef_file = ./irc/caps/defs.go
all: install all: install
install: install:
go install -v go install -v -ldflags "-X main.commit=$(GIT_COMMIT)"
build: build:
go build -v go build -v -ldflags "-X main.commit=$(GIT_COMMIT)"
release: release:
goreleaser --skip-publish --rm-dist goreleaser --skip-publish --rm-dist