From 12199736a9644e5430588e428e17254610de802a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Fri, 23 Feb 2024 13:25:50 +0000 Subject: [PATCH] centralize Go version used the action now has a default, so we don't have to specify the version anymore and we can bump the version for all builds in a single place --- .github/workflows/build-test.yaml | 15 --------------- .github/workflows/lint.yaml | 4 ---- .github/workflows/nightly.yaml | 4 ---- .github/workflows/release.yaml | 4 ---- .github/workflows/security.yaml | 6 ------ .github/workflows/wasm.yaml | 4 ---- Dockerfile | 4 ++-- Dockerfile.release | 2 +- 8 files changed, 3 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index e9748aa35f..c2a69a8467 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -11,7 +11,6 @@ on: # yamllint disable-line rule:truthy types: - "checks_requested" env: - GO_VERSION: "~1.21.3" DOCKERHUB_PUBLIC_ACCESS_TOKEN: "dckr_pat_8AEETZWxu8f7FvJUk9NrpyX_ZEQ" DOCKERHUB_PUBLIC_USER: "spicedbgithubactions" jobs: @@ -53,8 +52,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - uses: "docker/login-action@v3" with: username: "${{ env.DOCKERHUB_PUBLIC_USER }}" @@ -72,8 +69,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - name: "Unit tests" run: "go run mage.go test:unit" @@ -86,8 +81,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - uses: "docker/login-action@v3" with: username: "${{ env.DOCKERHUB_PUBLIC_USER }}" @@ -108,8 +101,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - uses: "docker/login-action@v3" with: username: "${{ env.DOCKERHUB_PUBLIC_USER }}" @@ -129,7 +120,6 @@ jobs: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" with: - go-version: "${{ env.GO_VERSION }}" go-version-file: "e2e/go.mod" cache-dependency-path: "e2e/go.sum" - name: "Cache Binaries" @@ -181,7 +171,6 @@ jobs: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" with: - go-version: "${{ env.GO_VERSION }}" go-version-file: "tools/analyzers/go.mod" cache-dependency-path: "tools/analyzers/go.sum" - name: "Analyzer tests" @@ -195,8 +184,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - name: "WASM tests" run: "go run mage.go test:wasm" @@ -209,8 +196,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - name: "Generate Protos" run: "go run mage.go gen:proto" - uses: "chainguard-dev/actions/nodiff@main" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1adac3b99b..d4f7f75614 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -10,8 +10,6 @@ on: # yamllint disable-line rule:truthy merge_group: types: - "checks_requested" -env: - GO_VERSION: "~1.21.3" jobs: go-lint: name: "Lint Go" @@ -19,8 +17,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - name: "Lint Go" run: "go run mage.go lint:go" - uses: "chainguard-dev/actions/nodiff@main" diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 6586038767..c21150993d 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -7,8 +7,6 @@ on: # yamllint disable-line rule:truthy permissions: contents: "write" packages: "write" -env: - GO_VERSION: "~1.21.3" jobs: goreleaser: runs-on: "buildjet-4vcpu-ubuntu-2204" @@ -17,8 +15,6 @@ jobs: with: fetch-depth: 0 - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - uses: "authzed/actions/docker-login@main" with: quayio_token: "${{ secrets.QUAYIO_PASSWORD }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3890f3eb83..dedcec872d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,8 +7,6 @@ on: # yamllint disable-line rule:truthy permissions: contents: "write" packages: "write" -env: - GO_VERSION: "~1.21.3" jobs: goreleaser: runs-on: "buildjet-4vcpu-ubuntu-2204" @@ -17,8 +15,6 @@ jobs: with: fetch-depth: 0 - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - uses: "authzed/actions/docker-login@main" with: quayio_token: "${{ secrets.QUAYIO_PASSWORD }}" diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 470fc31244..d44b3ba7b2 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -10,8 +10,6 @@ on: # yamllint disable-line rule:truthy merge_group: types: - "checks_requested" -env: - GO_VERSION: "~1.21.3" jobs: codeql: @@ -28,8 +26,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - uses: "authzed/actions/codeql@main" trivy: @@ -38,8 +34,6 @@ jobs: steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - uses: "aquasecurity/trivy-action@master" with: scan-type: "fs" diff --git a/.github/workflows/wasm.yaml b/.github/workflows/wasm.yaml index 611813babf..fdde3f2aa0 100644 --- a/.github/workflows/wasm.yaml +++ b/.github/workflows/wasm.yaml @@ -5,8 +5,6 @@ on: # yamllint disable-line rule:truthy types: ["created"] permissions: contents: "write" -env: - GO_VERSION: "~1.21.3" jobs: build: name: "Build WASM" @@ -16,8 +14,6 @@ jobs: with: ref: "${{ env.GITHUB_SHA }}" - uses: "authzed/actions/setup-go@main" - with: - go-version: "${{ env.GO_VERSION }}" - name: "Build WASM" run: "go run mage.go build:wasm" - uses: "shogo82148/actions-upload-release-asset@v1" diff --git a/Dockerfile b/Dockerfile index 5209dace76..3c4e0b18f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM golang:1.21.6-alpine3.18 AS spicedb-builder +FROM golang:1.22.0-alpine3.18 AS spicedb-builder WORKDIR /go/src/app RUN apk update && apk add --no-cache git COPY . . RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=0 go build -v ./cmd/... -FROM golang:1.21.6-alpine3.18 AS health-probe-builder +FROM golang:1.22.0-alpine3.18 AS health-probe-builder WORKDIR /go/src/app RUN apk update && apk add --no-cache git RUN git clone https://github.com/grpc-ecosystem/grpc-health-probe.git diff --git a/Dockerfile.release b/Dockerfile.release index 40cd1d9722..0ef73186ff 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -1,7 +1,7 @@ # vim: syntax=dockerfile ARG BASE=cgr.dev/chainguard/static:latest -FROM golang:1.21.6-alpine3.18 AS health-probe-builder +FROM golang:1.22.0-alpine3.18 AS health-probe-builder WORKDIR /go/src/app RUN apk update && apk add --no-cache git RUN git clone https://github.com/grpc-ecosystem/grpc-health-probe.git