From 4fad2b095af94cfa3cee1876af30c5274f77fd38 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Fri, 8 Mar 2024 06:07:19 +0000 Subject: [PATCH] Update golang to active supported version Signed-off-by: Henry Wang --- .github/workflows/test.yaml | 8 +++----- go.mod | 2 +- mk/dependencies/golangci.sh | 2 +- scripts/release.sh | 3 ++- 4 files changed, 7 insertions(+), 8 deletions(-) mode change 100644 => 100755 mk/dependencies/golangci.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f2ff17d9..989e2fdc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,7 +4,7 @@ name: test on: ["push", "pull_request"] env: - GO_VERSION: "1.19" + GO_VERSION: "1.22" LINUX_ARCHES: "amd64 386 arm arm64 s390x mips64le ppc64le" jobs: @@ -20,10 +20,10 @@ jobs: - uses: ibiqlik/action-yamllint@v3 with: format: auto - - uses: golangci/golangci-lint-action@v3 + - uses: golangci/golangci-lint-action@v4 with: args: --verbose - version: v1.51.2 + version: v1.54 build: name: Build all linux architectures needs: lint @@ -55,8 +55,6 @@ jobs: - uses: actions/checkout@v4 - name: Install test binaries - env: - GO111MODULE: off run: | go get github.com/mattn/goveralls go get github.com/modocache/gover diff --git a/go.mod b/go.mod index bb51abe0..217f4598 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/containernetworking/cni -go 1.18 +go 1.21 require ( github.com/Masterminds/semver/v3 v3.2.1 diff --git a/mk/dependencies/golangci.sh b/mk/dependencies/golangci.sh old mode 100644 new mode 100755 index f3079735..0e65a20b --- a/mk/dependencies/golangci.sh +++ b/mk/dependencies/golangci.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -GOLANGCI_LINT_VERSION="v1.51.2" +GOLANGCI_LINT_VERSION="v1.54" go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" \ No newline at end of file diff --git a/scripts/release.sh b/scripts/release.sh index d63c7112..818bced3 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -xe +GOLANG="${GOLANG:-golang:1.21-alpine}" SRC_DIR="${SRC_DIR:-$PWD}" BUILDFLAGS="-a --ldflags '-extldflags \"-static\"'" @@ -14,7 +15,7 @@ rm -Rf ${SRC_DIR}/${RELEASE_DIR} mkdir -p ${SRC_DIR}/${RELEASE_DIR} mkdir -p ${OUTPUT_DIR} -docker run -i -v ${SRC_DIR}:/opt/src --rm golang:1.14-alpine \ +docker run -i -v ${SRC_DIR}:/opt/src --rm "${GOLANG}" \ /bin/sh -xe -c "\ apk --no-cache add bash tar; cd /opt/src; umask 0022;