Skip to content

Commit 29eeea1

Browse files
committed
fix(ci): manually select Go version
For some reason, `setup-go` won't actually pick up a new patch version if it has an old one cached. We need to manually specify the versions so we can get the latest release. See: https://github.com/coder/coder/actions/runs/5026963985/jobs/9015878483#step:8:15
1 parent 02cc325 commit 29eeea1

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ concurrency:
2727
group: ${{ github.workflow }}-${{ github.ref }}
2828
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2929

30+
env:
31+
CODER_GO_VERSION: "1.20.4"
32+
3033
jobs:
3134
lint:
3235
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-8-cores' || 'ubuntu-latest' }}
@@ -37,7 +40,7 @@ jobs:
3740
# Install Go!
3841
- uses: actions/setup-go@v4
3942
with:
40-
go-version: "~1.20"
43+
go-version: ${{ env.CODER_GO_VERSION }}
4144

4245
# Check for any typos!
4346
- name: Check for typos
@@ -153,7 +156,7 @@ jobs:
153156
- uses: actions/setup-go@v4
154157
with:
155158
cache: false
156-
go-version: "~1.20"
159+
go-version: ${{ env.CODER_GO_VERSION }}
157160

158161
- name: Echo Go Cache Paths
159162
id: go-cache-paths
@@ -256,7 +259,7 @@ jobs:
256259
- uses: actions/setup-go@v4
257260
with:
258261
cache: false
259-
go-version: "~1.20"
262+
go-version: ${{ env.CODER_GO_VERSION }}
260263

261264
- name: Echo Go Cache Paths
262265
id: go-cache-paths
@@ -345,7 +348,7 @@ jobs:
345348
- uses: actions/setup-go@v4
346349
with:
347350
cache: false
348-
go-version: "~1.20"
351+
go-version: ${{ env.CODER_GO_VERSION }}
349352

350353
- name: Echo Go Cache Paths
351354
id: go-cache-paths
@@ -437,7 +440,7 @@ jobs:
437440
- uses: actions/setup-go@v4
438441
with:
439442
cache: false
440-
go-version: "~1.20"
443+
go-version: ${{ env.CODER_GO_VERSION }}
441444

442445
- name: Echo Go Cache Paths
443446
id: go-cache-paths
@@ -589,7 +592,7 @@ jobs:
589592
- uses: actions/setup-go@v4
590593
with:
591594
cache: false
592-
go-version: "~1.20"
595+
go-version: ${{ env.CODER_GO_VERSION }}
593596

594597
- uses: hashicorp/setup-terraform@v2
595598
with:

.github/workflows/release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ env:
2828
# https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/
2929
CODER_RELEASE: ${{ !inputs.dry_run }}
3030
CODER_DRY_RUN: ${{ inputs.dry_run }}
31+
CODER_GO_VERSION: "1.20.4"
3132

3233
jobs:
3334
release:
@@ -92,7 +93,7 @@ jobs:
9293

9394
- uses: actions/setup-go@v4
9495
with:
95-
go-version: "~1.20"
96+
go-version: ${{ env.CODER_GO_VERSION }}
9697

9798
- name: Cache Node
9899
id: cache-node

.github/workflows/security.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}-security
1919
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2020

21+
env:
22+
CODER_GO_VERSION: "1.20.4"
23+
2124
jobs:
2225
codeql:
2326
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-8-cores' || 'ubuntu-latest' }}
@@ -32,7 +35,7 @@ jobs:
3235
- name: Setup Go
3336
uses: actions/setup-go@v4
3437
with:
35-
go-version: "~1.20"
38+
go-version: ${{ env.CODER_GO_VERSION }}
3639

3740
- name: Go Cache Paths
3841
id: go-cache-paths
@@ -73,7 +76,7 @@ jobs:
7376

7477
- uses: actions/setup-go@v4
7578
with:
76-
go-version: "~1.20"
79+
go-version: ${{ env.CODER_GO_VERSION }}
7780

7881
- name: Go Cache Paths
7982
id: go-cache-paths

dogfood/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM ubuntu:jammy AS go
88

99
RUN apt-get update && apt-get install --yes curl gcc
1010
# Install Go manually, so that we can control the version
11-
ARG GO_VERSION=1.20
11+
ARG GO_VERSION=1.20.4
1212
RUN mkdir --parents /usr/local/go
1313

1414
# Boring Go is needed to build FIPS-compliant binaries.

0 commit comments

Comments
 (0)