Merge pull request #9214 from guggero/release-go-version-check
makefile+scripts: add Go version check to release command
This commit is contained in:
2 files changed
+14
-2
No files matched your search
@@ -162,7 +162,7 @@ release-install:
|
|||||||
release: clean-mobile
|
release: clean-mobile
|
||||||
@$(call print, "Releasing lnd and lncli binaries.")
|
@$(call print, "Releasing lnd and lncli binaries.")
|
||||||
$(VERSION_CHECK)
|
$(VERSION_CHECK)
|
||||||
./scripts/release.sh build-release "$(VERSION_TAG)" "$(BUILD_SYSTEM)" "$(RELEASE_TAGS)" "$(RELEASE_LDFLAGS)"
|
./scripts/release.sh build-release "$(VERSION_TAG)" "$(BUILD_SYSTEM)" "$(RELEASE_TAGS)" "$(RELEASE_LDFLAGS)" "$(GO_VERSION)"
|
||||||
|
|
||||||
#? docker-release: Same as release but within a docker container to support reproducible builds on BSD/MacOS platforms
|
#? docker-release: Same as release but within a docker container to support reproducible builds on BSD/MacOS platforms
|
||||||
docker-release:
|
docker-release:
|
||||||
|
|||||||
+13
-1
@@ -129,11 +129,23 @@ function check_tag_correct() {
|
|||||||
|
|
||||||
# build_release builds the actual release binaries.
|
# build_release builds the actual release binaries.
|
||||||
# arguments: <version-tag> <build-system(s)> <build-tags> <ldflags>
|
# arguments: <version-tag> <build-system(s)> <build-tags> <ldflags>
|
||||||
|
# <go-version>
|
||||||
function build_release() {
|
function build_release() {
|
||||||
local tag=$1
|
local tag=$1
|
||||||
local sys=$2
|
local sys=$2
|
||||||
local buildtags=$3
|
local buildtags=$3
|
||||||
local ldflags=$4
|
local ldflags=$4
|
||||||
|
local goversion=$5
|
||||||
|
|
||||||
|
# Check if the active Go version matches the specified Go version.
|
||||||
|
active_go_version=$(go version | awk '{print $3}' | sed 's/go//')
|
||||||
|
if [ "$active_go_version" != "$goversion" ]; then
|
||||||
|
echo "Error: active Go version ($active_go_version) does not match \
|
||||||
|
required Go version ($goversion)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Building release for tag $tag with Go version $goversion"
|
||||||
|
|
||||||
green " - Packaging vendor"
|
green " - Packaging vendor"
|
||||||
go mod vendor
|
go mod vendor
|
||||||
@@ -202,7 +214,7 @@ function build_release() {
|
|||||||
function usage() {
|
function usage() {
|
||||||
red "Usage: "
|
red "Usage: "
|
||||||
red "release.sh check-tag <version-tag>"
|
red "release.sh check-tag <version-tag>"
|
||||||
red "release.sh build-release <version-tag> <build-system(s)> <build-tags> <ldflags>"
|
red "release.sh build-release <version-tag> <build-system(s)> <build-tags> <ldflags> <go-version>"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Whatever sub command is passed in, we need at least 2 arguments.
|
# Whatever sub command is passed in, we need at least 2 arguments.
|
||||||
|
|||||||
Reference in new issue
Block a user