From 8a9eb4819fdcac1a2b39f0d1a86bb00aa4c22d00 Mon Sep 17 00:00:00 2001 From: Bob Callaway Date: Fri, 27 Sep 2024 07:12:41 -0400 Subject: [PATCH] restore go version logic in GHA Signed-off-by: Bob Callaway --- .github/workflows/build.yml | 7 +++---- .github/workflows/codeql-analysis.yml | 7 +++---- .github/workflows/main.yml | 7 +++---- .github/workflows/validate-release.yml | 8 ++++---- .github/workflows/verify.yml | 14 ++++++-------- go.mod | 4 +--- 6 files changed, 20 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79bdb702a..22496fc0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,13 +37,12 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0 - # TODO: uncomment when we bump to go1.22 in go.mod - # - name: Extract version of Go to use - # run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV + - name: Extract version of Go to use + run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: '1.22' + go-version: #{{ env.GOVERSION }} check-latest: true - name: deps diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 8018645a6..e28423220 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,13 +45,12 @@ jobs: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - # TODO: uncomment when we bump to go1.22 in go.mod - # - name: Extract version of Go to use - # run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV + - name: Extract version of Go to use + run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: '1.22' + go-version: ${{ env.GOVERSION }} check-latest: true # Initializes the CodeQL tools for scanning. diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e9773c4f..a354f80aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -213,13 +213,12 @@ jobs: - name: Create git branch run: git switch -c harness-test-branch - # TODO: uncomment when we bump to go1.22 in go.mod - # - name: Extract version of Go to use - # run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV + - name: Extract version of Go to use + run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: '1.22' + go-version: ${{ env.GOVERSION }} check-latest: true - name: Run test harness diff --git a/.github/workflows/validate-release.yml b/.github/workflows/validate-release.yml index 0d9a5a4ea..a56aff54b 100644 --- a/.github/workflows/validate-release.yml +++ b/.github/workflows/validate-release.yml @@ -28,14 +28,14 @@ jobs: check-signature: runs-on: ubuntu-latest container: - image: gcr.io/projectsigstore/cosign:v2.2.4-dev@sha256:13efd4c62710d75f07d12d8aad36a8657eeffd4f5f3a40bcbc207d8aafa67d41 + image: gcr.io/projectsigstore/cosign:v2.4.0-dev@sha256:a97b592b9f73390edcd6ceb5799a62513a906cbdffcdc63f53585910c71b0708 steps: - name: Check Signature run: | - cosign verify ghcr.io/gythialy/golang-cross:v1.22.5-0@sha256:5cf8fca7fe80392c8d1597fe89d291d49120507390f25507746f73d4b7f8a8f2 \ + cosign verify ghcr.io/gythialy/golang-cross:v1.23.1@sha256:af75ec9e913eecdeba4331fa186226e1a83d92bcc6edb734b877bd09d80bd257 \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ - --certificate-identity "https://github.com/gythialy/golang-cross/.github/workflows/release-golang-cross.yml@refs/tags/v1.22.5-0" + --certificate-identity "https://github.com/gythialy/golang-cross/.github/workflows/release-golang-cross.yml@refs/tags/v1.23.1" env: TUF_ROOT: /tmp @@ -44,7 +44,7 @@ jobs: needs: - check-signature container: - image: ghcr.io/gythialy/golang-cross:v1.22.5-0@sha256:5cf8fca7fe80392c8d1597fe89d291d49120507390f25507746f73d4b7f8a8f2 + image: ghcr.io/gythialy/golang-cross:v1.23.1@sha256:af75ec9e913eecdeba4331fa186226e1a83d92bcc6edb734b877bd09d80bd257 steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index a40119314..98e660d93 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -31,13 +31,12 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - # TODO: uncomment when we bump to go1.22 in go.mod - # - name: Extract version of Go to use - # run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV + - name: Extract version of Go to use + run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: '1.22' + go-version: ${{ env.GOVERSION }} - name: Install addlicense run: go install github.com/google/addlicense@v1.0.0 @@ -54,13 +53,12 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - # TODO: uncomment when we bump to go1.22 in go.mod - # - name: Extract version of Go to use - # run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV + - name: Extract version of Go to use + run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: - go-version: '1.22' + go-version: ${{ env.GOVERSION }} - name: golangci-lint uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 diff --git a/go.mod b/go.mod index 97fa5c6cc..1a5acc921 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/sigstore/rekor -go 1.23 - -toolchain go1.23.1 +go 1.23.1 require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2