Skip to content

Commit

Permalink
versions.sh: pull versions from go.mod again
Browse files Browse the repository at this point in the history
addresses review comment #408 (comment)
  • Loading branch information
feuGeneA committed Sep 4, 2024
1 parent 6cd8245 commit 9a0224b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@ function getDepVersion() {
grep -m1 "^\s*$1" $BASE_PATH/go.mod | cut -d ' ' -f2
}

extract_commit() {
local version=$1
if [[ $version == *-* ]]; then
# Extract the substring after the last '-'
version=${version##*-}
fi
echo "$version"
}

# This needs to be exported to be picked up by the dockerfile.
export GO_VERSION=${GO_VERSION:-$(getDepVersion go)}

# Don't export them as they're used in the context of other calls
# TODO: undo this hack once go.mod is referring to a tag rather than a commit
#AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-$(getDepVersion github.com/ava-labs/avalanchego)}
AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-ab83fb41528de93c1790301cdd67a07dda9299f0}
AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-$(extract_commit $(getDepVersion github.com/ava-labs/avalanchego))}
GINKGO_VERSION=${GINKGO_VERSION:-$(getDepVersion github.com/onsi/ginkgo/v2)}

# TODO: undo this hack once go.mod is referring to a tag rather than a commit
#SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-$(getDepVersion github.com/ava-labs/subnet-evm)}
SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-18633729a0cde7d695616e14b77873957a2b59c2}
SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-$(extract_commit $(getDepVersion github.com/ava-labs/subnet-evm))}

# Set golangci-lint version
GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION:-'v1.60'}
Expand Down

0 comments on commit 9a0224b

Please sign in to comment.