diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 198ef181..db46def2 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -43,9 +43,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup Go Version + run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - uses: actions/setup-go@v4 with: - go-version: '1.21.5' + go-version: ${{ env.GO_VERSION }} cache-dependency-path: "**/go.sum" - name: Install `govulncheck` run: go install golang.org/x/vuln/cmd/govulncheck@latest diff --git a/.go-version b/.go-version new file mode 100644 index 00000000..ce2dd535 --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.21.5 diff --git a/Makefile b/Makefile index 0a3fe7a0..7f5e38aa 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,14 @@ MAKEFILE_PATH = $(dir $(realpath -s $(firstword $(MAKEFILE_LIST)))) VERSION ?= $(GIT_VERSION) IMAGE ?= $(REPO):$(VERSION) BASE_IMAGE ?= public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:latest.2 -BUILD_IMAGE ?= public.ecr.aws/bitnami/golang:1.21.5 +GOLANG_VERSION ?= $(shell cat .go-version) +BUILD_IMAGE ?= public.ecr.aws/bitnami/golang:$(GOLANG_VERSION) GOARCH ?= amd64 PLATFORM ?= linux/amd64 +export GOSUMDB = sum.golang.org +export GOTOOLCHAIN = go$(GOLANG_VERSION) + help: ## Display help @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)