Skip to content

Commit

Permalink
Use Windows as host & add 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
KobeArthurScofield authored Jan 1, 2025
1 parent 5e4b415 commit 02aa94e
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 12 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/test-go1_22.yml
Original file line number Diff line number Diff line change
@@ -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: |
./*
10 changes: 4 additions & 6 deletions .github/workflows/test-go1_23.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: windows-latest
permissions:
contents: write
strategy:
Expand Down Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/test-go1_24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: windows-latest
permissions:
contents: write
strategy:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 02aa94e

Please sign in to comment.