goc version: dynamic inject the version value when publishing
This commit is contained in:
parent
2690f11488
commit
4b91d36d8d
@ -6,11 +6,11 @@ EVENT_DATA=$(cat $GITHUB_EVENT_PATH)
|
||||
echo $EVENT_DATA | jq .
|
||||
UPLOAD_URL=$(echo $EVENT_DATA | jq -r .release.upload_url)
|
||||
UPLOAD_URL=${UPLOAD_URL/\{?name,label\}/}
|
||||
RELEASE_NAME=$(echo $EVENT_DATA | jq -r .release.tag_name)
|
||||
RELEASE_VERSION=$(echo $EVENT_DATA | jq -r .release.tag_name)
|
||||
PROJECT_NAME=$(basename $GITHUB_REPOSITORY)
|
||||
NAME="${NAME:-${PROJECT_NAME}-${RELEASE_NAME}}-${GOOS}-${GOARCH}"
|
||||
NAME="${NAME:-${PROJECT_NAME}-${RELEASE_VERSION}}-${GOOS}-${GOARCH}"
|
||||
|
||||
go build .
|
||||
CGO_ENABLED=0 go build -ldflags "-X 'github.com/qiniu/goc/cmd.version=${RELEASE_VERSION}'" .
|
||||
|
||||
ARCHIVE=tmp.tar.gz
|
||||
FILE_LIST=goc
|
||||
|
1
go.mod
1
go.mod
@ -7,7 +7,6 @@ require (
|
||||
github.com/google/go-github v17.0.0+incompatible
|
||||
github.com/hashicorp/go-retryablehttp v0.6.6
|
||||
github.com/julienschmidt/httprouter v1.2.0
|
||||
github.com/magiconair/properties v1.8.1
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.4
|
||||
github.com/onsi/ginkgo v1.11.0
|
||||
|
Loading…
Reference in New Issue
Block a user