From 4c56261884f432535be2d006ba8b8472e59774cd Mon Sep 17 00:00:00 2001 From: chnliyong <4197225+chnliyong@users.noreply.github.com> Date: Fri, 29 Jan 2021 22:14:42 +0800 Subject: [PATCH] goreleaser: fix ldflags and change archive name template (#156) * goreleaser: fix ldflags and change archive name template * fix --- .goreleaser.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 93f11038022f..5a0d0b68e455 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,7 +3,6 @@ env: - GO111MODULE=on - CGO_ENABLED=1 - GOPROXY=https://gocenter.io - - PKG=github.com/juicedata/juicefs/pkg/version before: hooks: - go mod download @@ -12,7 +11,7 @@ builds: env: - CC=o64-clang - CXX=o64-clang++ - ldflags: -s -w -X ${PKG}.version={{.Version}} -X ${PKG}.revision={{.ShortCommit}} -X ${PKG}.revisionDate={{.CommitDate}} + ldflags: -s -w -X github.com/juicedata/juicefs/pkg/version.version={{.Version}} -X github.com/juicedata/juicefs/pkg/version.revision={{.ShortCommit}} -X github.com/juicedata/juicefs/pkg/version.revisionDate={{.CommitDate}} main: ./cmd goos: - darwin @@ -21,7 +20,7 @@ builds: - id: juicefs-linux-amd64 env: - STATIC=1 - ldflags: -s -w -X ${PKG}.version={{.Version}} -X ${PKG}.revision={{.ShortCommit}} -X ${PKG}.revisionDate={{.CommitDate}} + ldflags: -s -w -X github.com/juicedata/juicefs/pkg/version.version={{.Version}} -X github.com/juicedata/juicefs/pkg/version.revision={{.ShortCommit}} -X github.com/juicedata/juicefs/pkg/version.revisionDate={{.CommitDate}} main: ./cmd goos: - linux @@ -30,7 +29,7 @@ builds: - id: juicefs-linux-arm64 env: - CC=aarch64-linux-gnu-gcc - ldflags: -s -w -X ${PKG}.version={{.Version}} -X ${PKG}.revision={{.ShortCommit}} -X ${PKG}.revisionDate={{.CommitDate}} + ldflags: -s -w -X github.com/juicedata/juicefs/pkg/version.version={{.Version}} -X github.com/juicedata/juicefs/pkg/version.revision={{.ShortCommit}} -X github.com/juicedata/juicefs/pkg/version.revisionDate={{.CommitDate}} main: ./cmd goos: - linux @@ -46,6 +45,9 @@ changelog: exclude: - '^docs:' - '^test:' +archives: + - name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}" + brews: - tap: owner: juicedata