Skip to content

Commit 366f49e

Browse files
committed
build: eliminate GIT_BRANCH usage from build process
- Remove the use of the GIT_BRANCH environment variable and related linker flag from build scripts Signed-off-by: appleboy <[email protected]>
1 parent 34d0b2b commit 366f49e

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

.goreleaser.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
before:
22
hooks:
33
- go mod tidy
4-
- export GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
54
- export GO_VERSION=$(go version | cut -d " " -f 3)
65

76
builds:
@@ -64,7 +63,6 @@ builds:
6463
- -X 'github.com/appleboy/CodeGPT/version.Version={{.Version}}'
6564
- -X 'github.com/appleboy/CodeGPT/version.BuildTime={{.Date}}'
6665
- -X 'github.com/appleboy/CodeGPT/version.GitCommit={{.FullCommit}}'
67-
- -X 'github.com/appleboy/CodeGPT/version.GitBranch={{.Env.GIT_BRANCH}}'
6866
- -X 'github.com/appleboy/CodeGPT/version.GoVersion={{.Env.GO_VERSION}}'
6967
- -X 'github.com/appleboy/CodeGPT/version.BuildOS={{.Os}}'
7068
- -X 'github.com/appleboy/CodeGPT/version.BuildArch={{.Arch}}'

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ COMMIT ?= $(shell git rev-parse --short HEAD)
1919
LDFLAGS ?= -X 'github.com/appleboy/CodeGPT/version.Version=$(VERSION)' \
2020
-X 'github.com/appleboy/CodeGPT/version.BuildTime=$(shell date +%Y-%m-%dT%H:%M:%S)' \
2121
-X 'github.com/appleboy/CodeGPT/version.GitCommit=$(shell git rev-parse HEAD)' \
22-
-X 'github.com/appleboy/CodeGPT/version.GitBranch=$(shell git rev-parse --abbrev-ref HEAD)' \
2322
-X 'github.com/appleboy/CodeGPT/version.GoVersion=$(shell $(GO) version | cut -d " " -f 3)' \
2423
-X 'github.com/appleboy/CodeGPT/version.BuildOS=$(shell $(GO) env GOOS)' \
2524
-X 'github.com/appleboy/CodeGPT/version.BuildArch=$(shell $(GO) env GOARCH)'

0 commit comments

Comments
 (0)