-
Notifications
You must be signed in to change notification settings - Fork 16
118 lines (107 loc) · 3.31 KB
/
test-go_master.yml
File metadata and controls
118 lines (107 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Build patched Go master branch for tests
on:
workflow_dispatch:
schedule:
- cron: '10 14 1,16 * *'
push:
branches:
- build
paths:
- ".github/workflows/test-go_master.yml"
pull_request:
types: [opened, synchronize, reopened]
branches:
- build
paths:
- ".github/workflows/test-go_master.yml"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
goos: [windows]
goarch: [amd64, 386]
buildtarget: ['master']
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@v6
with:
repository: 'golang/go'
ref: ${{ matrix.buildtarget }}
- name: Apply patch
run: |
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/patchmaster/unified-master.diff | patch --verbose -p 1
- name: Set-up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
check-latest: true
cache: false
- 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@v7
with:
name: go-for-win7-master-${{ env.ASSET_NAME }}
path: |
./*
pre-cr:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
buildtarget: ['master']
fail-fast: false
steps:
- name: Download source
uses: actions/checkout@v6
with:
repository: 'golang/go'
ref: ${{ matrix.buildtarget }}
- name: Apply patch
run: |
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/patchmaster/unified-master.diff | patch --verbose -p 1
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/patchmaster/pre-KB3125574-master.diff | patch --verbose -p 1
- name: Upload package to Artifacts
uses: actions/upload-artifact@v7
with:
name: source-pre-KB3125574-master
path: |
./*