mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
set useDevelopmentVersion correctly for release builds
This commit is contained in:
3
.github/scripts/get_product_version.sh
vendored
3
.github/scripts/get_product_version.sh
vendored
@@ -28,8 +28,7 @@ LDFLAGS="-w -s"
|
||||
if [[ "$EXPERIMENTS_ENABLED" == 1 ]]; then
|
||||
LDFLAGS="${LDFLAGS} -X 'main.experimentsAllowed=yes'"
|
||||
fi
|
||||
LDFLAGS="${LDFLAGS} -X 'github.com/hashicorp/terraform/version.Version=${BASE_VERSION}'"
|
||||
LDFLAGS="${LDFLAGS} -X 'github.com/hashicorp/terraform/version.Prerelease=${PRERELEASE}'"
|
||||
LDFLAGS="${LDFLAGS} -X 'github.com/hashicorp/terraform/version.dev=no'"
|
||||
|
||||
echo "Building Terraform CLI ${VERSION}"
|
||||
if [[ "$EXPERIMENTS_ENABLED" == 1 ]]; then
|
||||
|
||||
@@ -41,9 +41,10 @@ export CGO_ENABLED=0
|
||||
# Set module download mode to readonly to not implicitly update go.mod
|
||||
export GOFLAGS="-mod=readonly"
|
||||
|
||||
# In release mode we don't want debug information in the binary
|
||||
# In release mode we don't want debug information in the binary and we don't
|
||||
# want the -dev version marker
|
||||
if [[ -n "${TF_RELEASE}" ]]; then
|
||||
LD_FLAGS="-s -w"
|
||||
LD_FLAGS="-s -w -X 'github.com/hashicorp/terraform/version.dev=no'"
|
||||
fi
|
||||
|
||||
# Ensure all remote modules are downloaded and cached before build so that
|
||||
|
||||
Reference in New Issue
Block a user