diff --git a/.circleci/config.yml b/.circleci/config.yml index fedba9ea4..ed9f399d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ parameters: defaults: &defaults resource_class: large docker: - - image: bepsays/ci-hugoreleaser:1.22600.20500 + - image: bepsays/ci-hugoreleaser:1.22700.20000 environment: &buildenv GOMODCACHE: /root/project/gomodcache version: 2 @@ -58,7 +58,7 @@ jobs: environment: <<: [*buildenv] docker: - - image: bepsays/ci-hugoreleaser-linux-arm64:1.22600.20500 + - image: bepsays/ci-hugoreleaser-linux-arm64:1.22700.20000 steps: - *restore-cache - &attach-workspace diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c104cf5e..8646415e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: test: strategy: matrix: - go-version: [1.26.x] + go-version: [1.27.x] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: diff --git a/go.mod b/go.mod index e10b249d2..db3f24bcf 100644 --- a/go.mod +++ b/go.mod @@ -186,4 +186,4 @@ require ( software.sslmate.com/src/go-pkcs12 v0.7.0 // indirect ) -go 1.26.0 +go 1.27.0 diff --git a/scripts/fork_go_templates/main.go b/scripts/fork_go_templates/main.go index b1af8621a..6787e1dab 100644 --- a/scripts/fork_go_templates/main.go +++ b/scripts/fork_go_templates/main.go @@ -15,8 +15,16 @@ import ( ) func main() { - // The current is built with 2dc996f71b0ebafb77e64433e58333e049488a3c go1.26.3 - // TODO(bep) preserve the staticcheck.conf file. + /* + Previously: with 2dc996f71b0ebafb77e64433e58333e049488a3c go1.26.3 + Current: 8af21751f0 [release-branch.go1.27] go1.27.0 + + Note that the upgrade here is mostly automatic, but there are some manual steps: + + * There's some unrelevant test codes that depends on some some internals in Go: Remove or stub these out to make it build. + * There's one failing test case as we have slightly cbhanged the meaning of isTrue. + * We're only patching the execution part of the template packages, so it's also good to check the execution package's Git history to check for valuable changes in our patched files. + */ fmt.Println("Forking ...") defer fmt.Println("Done ...") @@ -37,7 +45,6 @@ func main() { } const ( - // TODO(bep) goSource = "/Users/bep/dev/go/misc/go/src" forkRoot = "../../tpl/internal/go_templates" ) @@ -140,10 +147,18 @@ var fs = afero.NewOsFs() // Removes all non-Hugo files in the go_templates folder. func cleanFork() { + keepRe := regexp.MustCompile(`(?i)hugo|staticcheck\.conf`) must(filepath.Walk(filepath.Join(forkRoot), func(path string, info os.FileInfo, err error) error { - if !info.IsDir() && len(path) > 10 && !strings.Contains(path, "hugo") { - must(fs.Remove(path)) + if info.IsDir() || len(path) <= 10 { + return nil } + + if keepRe.MatchString(info.Name()) { + return nil + } + + must(fs.Remove(path)) + return nil })) }