diff --git a/.github/workflows/autopilot-branch-to-latest.yaml b/.github/workflows/autopilot-branch-to-latest.yaml index 789be371ec06..d44fc91c9e73 100644 --- a/.github/workflows/autopilot-branch-to-latest.yaml +++ b/.github/workflows/autopilot-branch-to-latest.yaml @@ -191,9 +191,10 @@ jobs: run: .github/workflows/prepare-build-env.sh - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Setup Terraform uses: hashicorp/setup-terraform@v3 diff --git a/.github/workflows/check-network.yaml b/.github/workflows/check-network.yaml index e817550d2e67..3a94a4168d9d 100644 --- a/.github/workflows/check-network.yaml +++ b/.github/workflows/check-network.yaml @@ -55,9 +55,10 @@ jobs: run: .github/workflows/prepare-build-env.sh - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Setup Terraform uses: hashicorp/setup-terraform@v3 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e453c7cfee5c..358563ad5fd4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -165,27 +165,10 @@ jobs: run: .github/workflows/prepare-build-env.sh - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} - - - name: Cache GOCACHE - uses: actions/cache@v4 - with: - key: unittests-k0s-windows-amd64-gocache-${{ github.ref_name }}-${{ github.sha }} - restore-keys: | - unittests-k0s-windows-amd64-gocache-${{ github.ref_name }}- - path: | - ~\AppData\Local\go-build - - - name: Cache GOMODCACHE - uses: actions/cache@v4 - with: - key: unittests-k0s-windows-amd64-gomodcache-${{ hashFiles('go.sum') }} - restore-keys: | - build-k0s-windows-amd64-gomodcache-${{ hashFiles('go.sum') }} - path: | - ~\go\pkg\mod + go-version-file: go.mod + cache: false - name: Run unit tests env: @@ -222,9 +205,10 @@ jobs: run: .github/workflows/prepare-docker-ipv6.sh - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Download compiled executable uses: actions/download-artifact@v4 @@ -285,9 +269,10 @@ jobs: run: .github/workflows/prepare-build-env.sh - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Download compiled executable uses: actions/download-artifact@v4 @@ -346,9 +331,10 @@ jobs: run: .github/workflows/prepare-build-env.sh - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Cache embedded binaries uses: actions/cache@v4 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d7fbdf2e26b1..8929f850f29c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -38,15 +38,12 @@ jobs: with: fetch-depth: 0 - - name: Go caches - uses: actions/cache@v4 + - name: Builder cache + uses: actions/cache@v3 with: key: ${{ runner.os }}-lint-go-caches-${{ hashFiles('go.sum') }} path: | build/cache - ~/go/pkg/mod - ~/.cache/go-build - ~/.cache/golangci-lint - name: Check go.mod/go.sum to be consistent run: make --always-make go.sum && git diff --exit-code diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 9867f50932b3..0c9d97c09f31 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -74,7 +74,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - TAGS=$(gh release list -L 1000 -R "$GITHUB_REPOSITORY" | grep "+k0s." | grep -v Draft | cut -f 1 | k0s_sort) + TAGS=$(gh release list -L 1000 -R "$GITHUB_REPOSITORY" | grep "+k0s." | grep -v Draft | cut -f 1 | ./k0s_sort) LATEST=$(echo "${TAGS}" | tail -1) STABLE=$(echo "${TAGS}" | grep -v -- "-" | tail -1) mike alias -u head main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e79c3f5d2b2..32392ff97bfa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,9 +65,10 @@ jobs: VERSION: ${{ needs.release.outputs.tag_name }} - name: Set up Go for smoke tests - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Run basic smoke test run: make check-basic @@ -254,9 +255,10 @@ jobs: /k0s/k0s --output-file /k0s/k0s.sig - name: Set up Go for smoke tests - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Run basic smoke test run: make check-basic @@ -362,9 +364,10 @@ jobs: /k0s/k0s --output-file /k0s/k0s.sig - name: Set up Go for smoke tests - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Run basic smoke test run: make check-basic @@ -581,9 +584,10 @@ jobs: run: .github/workflows/prepare-build-env.sh - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache: false - name: Setup Terraform uses: hashicorp/setup-terraform@v3 diff --git a/hack/tools/gen-matrix.sh b/hack/tools/gen-matrix.sh index 95a09925dc3f..bf725578854b 100755 --- a/hack/tools/gen-matrix.sh +++ b/hack/tools/gen-matrix.sh @@ -13,8 +13,12 @@ list_k0s_releases() { VERSION_PREFIX="v$1" gh api -X GET /repos/k0sproject/k0s/releases -F per_page=100 --paginate --jq "$query" } +k0s_sort() { + go run github.com/k0sproject/version/cmd/k0s_sort@v0.6.0 -l +} + latest_release() { - list_k0s_releases "$1" | k0s_sort -l + list_k0s_releases "$1" | k0s_sort } json_print_latest_releases() {