From 02aa94e353bcccc69cad71d5351396489c32cbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=90=B2=93=F0=90=B3=9B=F0=90=B3=AA=F0=90=B3=82?= =?UTF-8?q?=F0=90=B3=90=20=F0=90=B2=80=F0=90=B3=A2=F0=90=B3=A6=F0=90=B3=AB?= =?UTF-8?q?=F0=90=B3=A2=20=F0=90=B2=A5=F0=90=B3=94=F0=90=B3=9B=F0=90=B3=AA?= =?UTF-8?q?=F0=90=B3=8C=F0=90=B3=91=F0=90=B3=96=F0=90=B3=87?= <26771058+KobeArthurScofield@users.noreply.github.com> Date: Thu, 2 Jan 2025 02:22:13 +0800 Subject: [PATCH] Use Windows as host & add 1.22 --- .github/workflows/test-go1_22.yml | 74 +++++++++++++++++++++++++++++++ .github/workflows/test-go1_23.yml | 10 ++--- .github/workflows/test-go1_24.yml | 10 ++--- 3 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/test-go1_22.yml diff --git a/.github/workflows/test-go1_22.yml b/.github/workflows/test-go1_22.yml new file mode 100644 index 00000000000000..5898400419642c --- /dev/null +++ b/.github/workflows/test-go1_22.yml @@ -0,0 +1,74 @@ +name: Build patched Go 1.22 for tests + +on: + workflow_dispatch: + push: + branches: + - build + - release-branch.go1.22 + paths: + - ".github/workflows/test-go1_22.yml" + - "**/*.go" + pull_request: + types: [opened, synchronize, reopened] + branches: + - build + - release-branch.go1.22 + paths: + - ".github/workflows/test-go1_22.yml" + - "**/*.go" + +jobs: + build: + runs-on: windows-latest + permissions: + contents: write + strategy: + matrix: + goos: [windows] + goarch: [amd64, 386] + buildtarget: ['release-branch.go1.22'] + fail-fast: false + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + CGO_ENABLED: 0 + steps: + - name: Show workflow information + run: | + _NAME="$GOOS-$GOARCH" + echo "GOOS: $GOOS, GOARCH: $GOARCH, APPLY-BRANCH: ${{ matrix.buildtarget }}" + echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV + + - name: Set-up Go + uses: actions/setup-go@v5 + with: + go-version: stable + check-latest: true + + - name: Download source + uses: actions/checkout@v4 + with: + repository: 'golang/go' + ref: ${{ matrix.buildtarget }} + + # Patches for Go 1.24.x before more minor changes introduces. + - name: Apply patch + run: | + curl https://github.com/XTLS/go-win7/commit/47686a8247e6671fd1b5b4cdae4a922a3e2f1f3b.diff | patch --verbose -p 1 + curl https://github.com/XTLS/go-win7/commit/60dbd2bd6246daac20073582faf72db385e3180a.diff | patch --verbose -p 1 + curl https://github.com/XTLS/go-win7/commit/b6c011ff7621391034ed4287ab76aadf820dcbca.diff | patch --verbose -p 1 + curl https://github.com/XTLS/go-win7/commit/106b03e22547611763c7df037831601d4c080753.diff | patch --verbose -p 1 + + - name: Build patched Go + run: | + cd ./src + ./all.bat + cd .. + + - name: Upload package to Artifacts + uses: actions/upload-artifact@v4 + with: + name: go-for-win7-${{ env.ASSET_NAME }} + path: | + ./* diff --git a/.github/workflows/test-go1_23.yml b/.github/workflows/test-go1_23.yml index 11a265dbdf5a3f..66e63536d11646 100644 --- a/.github/workflows/test-go1_23.yml +++ b/.github/workflows/test-go1_23.yml @@ -20,7 +20,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest permissions: contents: write strategy: @@ -61,12 +61,10 @@ jobs: curl https://github.com/XTLS/go-win7/commit/ac17c301268dd7835236e61c9bfefdf2b8e633d5.diff | patch --verbose -p 1 - name: Build patched Go - shell: bash run: | - cd ./src - . ./make.bash "$@" --no-banner - "$GOTOOLDIR/dist" banner - cd .. + cd ./src + ./all.bat + cd .. - name: Upload package to Artifacts uses: actions/upload-artifact@v4 diff --git a/.github/workflows/test-go1_24.yml b/.github/workflows/test-go1_24.yml index a758efcab3cbb7..2739372612ede2 100644 --- a/.github/workflows/test-go1_24.yml +++ b/.github/workflows/test-go1_24.yml @@ -20,7 +20,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest permissions: contents: write strategy: @@ -62,12 +62,10 @@ jobs: curl https://github.com/XTLS/go-win7/commit/a3e4d4735a5d89f60b907308b556c5a53614914d.diff | patch --verbose -p 1 - name: Build patched Go - shell: bash run: | - cd ./src - . ./make.bash "$@" --no-banner - "$GOTOOLDIR/dist" banner - cd .. + cd ./src + ./all.bat + cd .. - name: Upload package to Artifacts uses: actions/upload-artifact@v4