Skip to content

Patched Go 1.24.0 for Windows 7 #28

Patched Go 1.24.0 for Windows 7

Patched Go 1.24.0 for Windows 7 #28

Workflow file for this run

name: Build patched Go and release
on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- build
paths:
- ".github/workflows/release.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/release.yml"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
goos: [windows, linux]
goarch: [amd64, 386, arm64]
buildtarget: ['go1.24.0']
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, GOVER: ${{ 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.24.x before more minor changes introduces.
- name: Apply patch
run: |
curl https://github.com/XTLS/go-win7/commit/f429f15f6305e4432afd7309b317e903bd76a5c0.diff | patch --verbose -p 1
curl https://github.com/XTLS/go-win7/commit/41f545de980e9285b68ece40d4b4e63feef9c5a1.diff | patch --verbose -p 1
curl https://github.com/XTLS/go-win7/commit/b6c99a977f732ee5553ddc75ae0fe3b47927fc1c.diff | patch --verbose -p 1
curl https://github.com/XTLS/go-win7/commit/36d7775e030192d3bf2dc111d1f6cfa89eae5f0c.diff | patch --verbose -p 1
curl https://github.com/XTLS/go-win7/commit/a3e4d4735a5d89f60b907308b556c5a53614914d.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
"$GOTOOLDIR/dist" banner
cd ..
- name: Copy binaries into bin
shell: bash
run: |
cd ./bin
DIRS=(windows_amd64 windows_386 windows_arm64 linux_386 linux_arm64)
for DIR in "${DIRS[@]}"
do
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
done
cd ..
ls -al ./bin
- name: Copy License
run: |
rm ./LICENSE
curl -O https://raw.githubusercontent.com/XTLS/go-win7/refs/heads/build/LICENSE
- name: Upload package to Artifacts
uses: actions/upload-artifact@v4
with:
name: go-for-win7-${{ env.ASSET_NAME }}
path: |
./*
- name: create ZIP archive
if: github.event_name == 'release'
shell: bash
run: |
zip -9vr ./go-for-win7-${{ env.ASSET_NAME }}.zip . -x "./.*" "./.*/*" "./**/.*" "./**/.*/*"
- name: Compute hashes for file
if: github.event_name == 'release'
run: |
FILE=./go-for-win7-${{ env.ASSET_NAME }}.zip
DGST=$FILE.dgst
for METHOD in {"md5","sha1","sha256","sha512"}
do
openssl dgst -$METHOD $FILE | sed 's/([^)]*)//g' >>$DGST
done
- name: Upload packages to release
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./go-for-win7-${{ env.ASSET_NAME }}.zip*
tag: ${{ github.ref }}
file_glob: true