Skip to content

Build patched Go 1.25 for tests #18

Build patched Go 1.25 for tests

Build patched Go 1.25 for tests #18

Workflow file for this run

name: Build patched Go 1.25 for tests
on:
workflow_dispatch:
schedule:
- cron: '20 0 * * 6'
push:
branches:
- build
- "release-branch.go1.25"
paths:
- ".github/workflows/test-go1_25.yml"
- "**/*.go"
pull_request:
types: [opened, synchronize, reopened]
branches:
- build
- "release-branch.go1.25"
paths:
- ".github/workflows/test-go1_25.yml"
- "**/*.go"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
goos: [windows]
goarch: [amd64, 386]
buildtarget: ['release-branch.go1.25']
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: Download source
uses: actions/checkout@v4
with:
repository: 'golang/go'
ref: ${{ matrix.buildtarget }}
# Patches for Go 1.25.x before more minor changes introduces.
- name: Apply patch
run: |
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/unified-1-25-patch.diff | patch --verbose -p 1
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/830f1acfc984be44520621b001096845ebf40c7a.diff | patch --verbose -p 1
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/b5e4a6d5b3d0b076414d04cc3d6002f816bc0c25.diff | patch --verbose -p 1
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/949393bde276adbeaf41688f086feb23e24abe88.diff | patch --verbose -p 1
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/fc29c4ae1cd53d6761d4324c4625cc8a149c55d3.diff | patch --verbose -p 1
- name: Set-up Go
uses: actions/setup-go@v5
with:
go-version-file: 'src/go.mod'
check-latest: true
- name: Build patched Go
shell: bash
run: |
cd ./src
. ./make.bash "$@" --no-banner
../bin/go tool dist banner
cd ..
- name: Copy binaries into bin
if: matrix.goos != 'linux' || matrix.goarch != 'amd64'
shell: bash
run: |
cd ./bin
DIR="${GOOS}_${GOARCH}"
if [ -d "${DIR}" ]; then
echo "Found ${DIR} copying binaries"
rm ./go*
for BINARY in "${DIR}"/*
do
echo "mv ./${BINARY} ./"
mv ./${BINARY} ./
done
rm -r ./"${DIR}"
rm -r ../pkg/tool/linux_amd64/
fi
cd ..
ls -al ./bin
- name: Upload package to Artifacts
uses: actions/upload-artifact@v4
with:
name: go-for-win7-${{ env.ASSET_NAME }}
path: |
./*