File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ release-install:
118118release :
119119 @$(call print, "Releasing tapd and tapcli binaries.")
120120 $(VERSION_CHECK )
121- ./scripts/release.sh build-release " $( VERSION_TAG) " " $( BUILD_SYSTEM) " " $( RELEASE_TAGS) " " $( RELEASE_LDFLAGS) "
121+ ./scripts/release.sh build-release " $( VERSION_TAG) " " $( BUILD_SYSTEM) " " $( RELEASE_TAGS) " " $( RELEASE_LDFLAGS) " " $( GO_VERSION ) "
122122
123123release-tag :
124124 @$(call print, "Adding release tag.")
Original file line number Diff line number Diff line change @@ -118,11 +118,23 @@ function check_tag_correct() {
118118
119119# build_release builds the actual release binaries.
120120# arguments: <version-tag> <build-system(s)> <build-tags> <ldflags>
121+ # <go-version>
121122function build_release() {
122123 local tag=$1
123124 local sys=$2
124125 local buildtags=$3
125126 local ldflags=$4
127+ local goversion=$5
128+
129+ # Check if the active Go version matches the specified Go version.
130+ active_go_version=$( go version | awk ' {print $3}' | sed ' s/go//' )
131+ if [ " $active_go_version " != " $goversion " ]; then
132+ echo " Error: active Go version ($active_go_version ) does not match \
133+ required Go version ($goversion )."
134+ exit 1
135+ fi
136+
137+ echo " Building release for tag $tag with Go version $goversion "
126138
127139 green " - Packaging vendor"
128140 go mod vendor
You can’t perform that action at this time.
0 commit comments