File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,25 @@ other tools:
5858sudo apt-get install build-essential git make zip perl gpg
5959```
6060
61+ You can [ download] ( https://go.dev/dl/ ) and unpack Go somewhere and set variable
62+ ` GO_CMD=/path/to/go ` (path to Go binary of the needed version).
63+
64+ If you already have another Go version, you can install the Go version needed
65+ for a release using the following commands:
66+
67+ ``` bash
68+ $ go version
69+ go version go1.25.0 linux/amd64
70+ $ go install golang.org/dl/go1.24.6@latest
71+ $ go1.24.6 download
72+ Unpacking /home/user/sdk/go1.24.6/go1.24.6.linux-amd64.tar.gz ...
73+ Success. You may now run ' go1.24.6'
74+ $ go1.24.6 version
75+ go version go1.24.6 linux/amd64
76+
77+ $ GO_CMD=/home/user/go/bin/go1.24.6 ./release.sh v0.31.3
78+ ```
79+
6180On MacOS, you will need to install GNU tar and GNU gzip, which can be done with
6281` brew ` :
6382
Original file line number Diff line number Diff line change @@ -27,6 +27,25 @@ function red() {
2727 echo -e " \e[0;31m${1} \e[0m"
2828}
2929
30+ # Use GO_CMD from env if set, otherwise default to "go".
31+ GO_CMD=" ${GO_CMD:- go} "
32+
33+ # Check if the command exists.
34+ if ! command -v " $GO_CMD " > /dev/null 2>&1 ; then
35+ red " Error: Go command '$GO_CMD ' not found"
36+ exit 1
37+ fi
38+
39+ # Make sure we have the expected Go version installed.
40+ EXPECTED_VERSION=" go1.24.6"
41+ INSTALLED_VERSION=$( " $GO_CMD " version 2> /dev/null | awk ' {print $3}' )
42+ if [ " $INSTALLED_VERSION " = " $EXPECTED_VERSION " ]; then
43+ green " Go version matches expected: $INSTALLED_VERSION "
44+ else
45+ red " Error: Expected Go version $EXPECTED_VERSION but found $INSTALLED_VERSION "
46+ exit 1
47+ fi
48+
3049TAG=' '
3150
3251check_tag () {
203222green " - Creating artifacts directory ${ARTIFACTS_DIR} "
204223mkdir -p " $ARTIFACTS_DIR "
205224green " - Packaging vendor to ${ARTIFACTS_DIR} /vendor.tar.gz"
206- go mod vendor
225+ " $GO_CMD " mod vendor
207226reproducible_tar_gzip vendor " ${ARTIFACTS_DIR} /vendor.tar.gz"
208227rm -r vendor
209228
@@ -248,7 +267,7 @@ for i in $SYS; do
248267
249268 green " - Building: $OS $ARCH $ARM "
250269 for bin in loop loopd; do
251- env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -trimpath -ldflags " $COMMITFLAGS " " github.com/lightninglabs/loop/cmd/$bin "
270+ env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM " $GO_CMD " build -v -trimpath -ldflags " $COMMITFLAGS " " github.com/lightninglabs/loop/cmd/$bin "
252271 done
253272 cd ..
254273
You can’t perform that action at this time.
0 commit comments