Skip to content

Commit

Permalink
go.mod: set toolchain to go1.24.0 & update github actions
Browse files Browse the repository at this point in the history
Locally and in ci this will preffer, but not require, 1.24. As
currently we preffer to pick up 1.24 features (i.e. PQC TLS), but do
not explicitely require it.

Regularly bump the toolchain stanza to new upstream releases.

Whenever a toolchain feature becomes required do bump go stanza.
  • Loading branch information
xnox committed Feb 17, 2025
1 parent d638a39 commit 04ed664
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/actions/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ runs:
repository: wolfi-dev/wolfictl
path: wolfictl-setup-gha

# Until https://github.com/actions/setup-go/issues/457 is fixed
- id: gotoolchain
run: echo "version=$(sed -ne 's|^toolchain go||p' wolfictl-setup-gha/go.mod)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: '1.21'
check-latest: true
go-version: '${{ steps.gotoolchain.outputs.version}}'

- id: build
shell: bash
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ jobs:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Until https://github.com/actions/setup-go/issues/457 is fixed
- id: gotoolchain
run: echo "version=$(sed -ne 's|^toolchain go||p' go.mod)" >> "$GITHUB_OUTPUT"

- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
check-latest: true
go-version: '${{ steps.gotoolchain.outputs.version}}'

- uses: chainguard-dev/actions/goimports@2cadca168a422313df94f6169691a86498ae51b1 # main
- run: make wolfictl
Expand All @@ -48,10 +50,13 @@ jobs:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Until https://github.com/actions/setup-go/issues/457 is fixed
- id: gotoolchain
run: echo "version=$(sed -ne 's|^toolchain go||p' go.mod)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
check-latest: true
go-version: '${{ steps.gotoolchain.outputs.version}}'

- run: make wolfictl
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -93,10 +98,13 @@ jobs:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Until https://github.com/actions/setup-go/issues/457 is fixed
- id: gotoolchain
run: echo "version=$(sed -ne 's|^toolchain go||p' go.mod)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
check-latest: true
go-version: '${{ steps.gotoolchain.outputs.version}}'

- run: rm -rf docs/**/*.md docs/**/*.1
- run: make docs
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ jobs:

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Until https://github.com/actions/setup-go/issues/457 is fixed
- id: gotoolchain
run: echo "version=$(sed -ne 's|^toolchain go||p' go.mod)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
check-latest: true
cache: false
go-version: '${{ steps.gotoolchain.outputs.version}}'

- name: golangci-lint
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
with:
version: v1.63 # Please keep this in sync with the Makefile!
install-mode: goinstall # To get matching toolchain build
version: v1.64.5 # Please keep this in sync with the Makefile!
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ golangci-lint:
set -e ;\

# Please keep the installed version in sync with .github/workflows/golangci-lint.yaml
GOBIN=$(GOLANGCI_LINT_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4 ;\
GOBIN=$(GOLANGCI_LINT_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5 ;\

.PHONY: fmt
fmt: ## Format all go files
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/wolfi-dev/wolfictl

go 1.23.4

toolchain go1.24.0

// https://github.com/anchore/grype/blob/v0.80.1/go.mod#L266-L269
// Pull in a fix for an unpatched CVE. mholt/archiver appears inactive/unmaintained.
replace github.com/mholt/archiver/v3 => github.com/anchore/archiver/v3 v3.5.2
Expand Down

0 comments on commit 04ed664

Please sign in to comment.