Fix mis-versioning due to hardcoding cmd.Version (#1431)

This commit is contained in:
Takumi Sue 2022-11-14 14:38:43 +09:00 committed by GitHub
parent ffc20f7e2c
commit 1fd96e168e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -45,6 +45,8 @@ jobs:
mkdir -p build
cp yq.1 build/yq.1
./scripts/xcompile.sh
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
- name: Release
uses: softprops/action-gh-release@v1

View File

@ -11,7 +11,7 @@ var (
GitDescribe string
// Version is main version number that is being run at the moment.
Version = "4.30.1"
Version = ""
// VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
// then it means that it is a final release. Otherwise, this is a pre-release

View File

@ -1,8 +1,8 @@
#!/bin/bash
set -e
# you may need to go install github.com/mitchellh/gox@v1.0.1 first
CGO_ENABLED=0 gox -ldflags "${LDFLAGS}" -output="build/yq_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 darwin/arm64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm linux/arm64 linux/mips linux/mips64 linux/mips64le linux/mipsle linux/ppc64 linux/ppc64le linux/s390x netbsd/386 netbsd/amd64 netbsd/arm openbsd/386 openbsd/amd64 windows/386 windows/amd64"
echo $VERSION
CGO_ENABLED=0 gox -ldflags "${LDFLAGS} -X cmd.Version=${VERSION}" -output="build/yq_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 darwin/arm64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm linux/arm64 linux/mips linux/mips64 linux/mips64le linux/mipsle linux/ppc64 linux/ppc64le linux/s390x netbsd/386 netbsd/amd64 netbsd/arm openbsd/386 openbsd/amd64 windows/386 windows/amd64"
cd build
@ -21,4 +21,4 @@ rhash -r -a . -o checksums
rhash --list-hashes > checksums_hashes_order
cp ../scripts/extract-checksum.sh .
cp ../scripts/extract-checksum.sh .