From 5eb318ba061a2c4d2f6e822862b763eb1a9c50dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 13 Aug 2025 21:15:43 +0800 Subject: [PATCH] Update Go to 1.25 --- .github/setup_legacy_go.sh | 2 +- .github/workflows/build.yml | 42 +++++++++++++++++++++---------------- .github/workflows/lint.yml | 2 +- .github/workflows/linux.yml | 4 ++-- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/setup_legacy_go.sh b/.github/setup_legacy_go.sh index 3f1a31ad..d4617e79 100755 --- a/.github/setup_legacy_go.sh +++ b/.github/setup_legacy_go.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERSION="1.23.6" +VERSION="1.23.12" mkdir -p $HOME/go cd $HOME/go diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ccc81a8..6da08464 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.24.6 + go-version: ^1.25.0 - name: Check input version if: github.event_name == 'workflow_dispatch' run: |- @@ -88,13 +88,14 @@ jobs: - { os: linux, arch: loong64, debian: loongarch64, rpm: loongarch64, openwrt: "loongarch64_generic" } - { os: windows, arch: amd64 } - - { os: windows, arch: amd64, legacy_go: true } + - { os: windows, arch: amd64, legacy_go123: true, legacy_name: "windows-7" } - { os: windows, arch: "386" } - - { os: windows, arch: "386", legacy_go: true } + - { os: windows, arch: "386", legacy_go123: true, legacy_name: "windows-7" } - { os: windows, arch: arm64 } - { os: darwin, arch: amd64 } - { os: darwin, arch: arm64 } + - { os: darwin, arch: amd64, legacy_go124: true, legacy_name: "macos-11" } - { os: android, arch: arm64, ndk: "aarch64-linux-android21" } - { os: android, arch: arm, ndk: "armv7a-linux-androideabi21" } @@ -106,24 +107,29 @@ jobs: with: fetch-depth: 0 - name: Setup Go - if: ${{ ! matrix.legacy_go }} + if: ${{ ! (matrix.legacy_go123 || matrix.legacy_go124) }} uses: actions/setup-go@v5 with: - go-version: ^1.24.6 - - name: Cache Legacy Go - if: matrix.require_legacy_go + go-version: ^1.25.0 + - name: Setup Go 1.24 + if: matrix.legacy_go124 + uses: actions/setup-go@v5 + with: + go-version: ~1.24.6 + - name: Cache Go 1.23 + if: matrix.legacy_go123 id: cache-legacy-go uses: actions/cache@v4 with: path: | ~/go/go_legacy - key: go_legacy_1236 - - name: Setup Legacy Go - if: matrix.legacy_go && steps.cache-legacy-go.outputs.cache-hit != 'true' + key: go_legacy_12312 + - name: Setup Go 1.23 + if: matrix.legacy_go123 && steps.cache-legacy-go.outputs.cache-hit != 'true' run: |- .github/setup_legacy_go.sh - - name: Setup Legacy Go 2 - if: matrix.legacy_go + - name: Setup Go 1.23 + if: matrix.legacy_go123 run: |- echo "PATH=$HOME/go/go_legacy/bin:$PATH" >> $GITHUB_ENV echo "GOROOT=$HOME/go/go_legacy" >> $GITHUB_ENV @@ -184,8 +190,8 @@ jobs: DIR_NAME="${DIR_NAME}-${{ matrix.go386 }}" elif [[ -n "${{ matrix.gomips }}" && "${{ matrix.gomips }}" != 'hardfloat' ]]; then DIR_NAME="${DIR_NAME}-${{ matrix.gomips }}" - elif [[ "${{ matrix.legacy_go }}" == 'true' ]]; then - DIR_NAME="${DIR_NAME}-legacy" + elif [[ -n "${{ matrix.legacy_name }}" ]]; then + DIR_NAME="${DIR_NAME}-legacy-${{ matrix.legacy_name }}" fi echo "DIR_NAME=${DIR_NAME}" >> "${GITHUB_ENV}" PKG_VERSION="${{ needs.calculate_version.outputs.version }}" @@ -277,7 +283,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: binary-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.goarm && format('v{0}', matrix.goarm) }}${{ matrix.go386 && format('_{0}', matrix.go386) }}${{ matrix.gomips && format('_{0}', matrix.gomips) }}${{ matrix.legacy_go && '-legacy' || '' }} + name: binary-${{ matrix.os }}_${{ matrix.arch }}${{ matrix.goarm && format('v{0}', matrix.goarm) }}${{ matrix.go386 && format('_{0}', matrix.go386) }}${{ matrix.gomips && format('_{0}', matrix.gomips) }}${{ matrix.legacy_name && format('-legacy-{0}', matrix.legacy_name) }} path: "dist" build_android: name: Build Android @@ -294,7 +300,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.24.6 + go-version: ^1.25.0 - name: Setup Android NDK id: setup-ndk uses: nttld/setup-ndk@v1 @@ -374,7 +380,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.24.6 + go-version: ^1.25.0 - name: Setup Android NDK id: setup-ndk uses: nttld/setup-ndk@v1 @@ -472,7 +478,7 @@ jobs: if: matrix.if uses: actions/setup-go@v5 with: - go-version: ^1.24.6 + go-version: ^1.25.0 - name: Setup Xcode stable if: matrix.if && github.ref == 'refs/heads/main-next' run: |- diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 08d54402..b481fef0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,7 +28,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.24.6 + go-version: ^1.25.0 - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ad0c8af5..eea2e545 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -30,7 +30,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.24.6 + go-version: ^1.25.0 - name: Check input version if: github.event_name == 'workflow_dispatch' run: |- @@ -71,7 +71,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: ^1.24.6 + go-version: ^1.25.0 - name: Setup Android NDK if: matrix.os == 'android' uses: nttld/setup-ndk@v1