Skip to content

Refinement of processes #15

Refinement of processes

Refinement of processes #15

Workflow file for this run

name: Build patched Go 1.22 for tests
on:
workflow_dispatch:
#schedule:
#- cron: '0 0 1-20 * 2,4,6'
#- cron: '0 0 21-31 * 6'
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: ubuntu-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: Download source
uses: actions/checkout@v4
with:
repository: 'golang/go'
ref: ${{ matrix.buildtarget }}
# Patches for Go 1.22.x before more minor changes introduces.
- name: Apply patch
run: |
curl https://github.com/XTLS/go-win7/commit/e4701f06a6358bda901e72cbff44f414d902e988.diff | patch --verbose -p 1
curl https://github.com/XTLS/go-win7/commit/41373f90356fd86e9cbe78c7a71c76066a6730c1.diff | patch --verbose -p 1
curl https://github.com/XTLS/go-win7/commit/481cebf65c4052379cf3cda5db5588c48f2446f6.diff | patch --verbose -p 1
curl https://github.com/XTLS/go-win7/commit/21d5caecf644a12d938c45f18e2b55f04b47f0b0.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)
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}"
fi
done
cd ..
ls -al ./bin
- name: Cleanup other directories
shell: bash
run: |
rm -r ./pkg/tool/linux_amd64/
- name: Upload package to Artifacts
uses: actions/upload-artifact@v4
with:
name: go-for-win7-${{ env.ASSET_NAME }}
path: |
./*