releaser: Use Git short commit in release binaries
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 26 Dec 2018 10:31:58 +0000 (11:31 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 26 Dec 2018 10:31:58 +0000 (11:31 +0100)
Fixes #5562

goreleaser-extended.yml
goreleaser.yml

index ce4b82a94a40c3c49285cd38a7c39b6ddb1ce5de..8be27888099579c0f9cd44c9edf3b7c0312a9bb7 100644 (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:
index e52312b9c92fbdd4f38f74042eb25a6b17a2a14c..5f3e444cce24a749d6007b64d44cdf845adae710 100644 (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: