releaser: Use Git short commit in release binaries

Fixes #5562
This commit is contained in:
Bjørn Erik Pedersen 2018-12-26 11:31:58 +01:00
parent ecc8922752
commit 214e9745b6
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 4 additions and 4 deletions

View file

@ -2,7 +2,7 @@ project_name: hugo_extended
builds:
- binary: hugo
ldflags:
- -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .Commit }}
- -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .ShortCommit }}
- "-extldflags '-static'"
env:
- CGO_ENABLED=1
@ -16,7 +16,7 @@ builds:
goarch:
- amd64
- binary: hugo
ldflags: -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .Commit }}
ldflags: -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .ShortCommit }}
env:
- CGO_ENABLED=1
- CC=o64-clang
@ -29,7 +29,7 @@ builds:
goarch:
- amd64
- binary: hugo
ldflags: -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .Commit }}
ldflags: -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .ShortCommit }}
env:
- CGO_ENABLED=1
flags:

View file

@ -2,7 +2,7 @@ project_name: hugo
build:
main: main.go
binary: hugo
ldflags: -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .Commit }}
ldflags: -s -w -X github.com/gohugoio/hugo/common/hugo.buildDate={{.Date}} -X github.com/gohugoio/hugo/common/hugo.commitHash={{ .ShortCommit }}
env:
- CGO_ENABLED=0
goos: