Skip to content

Commit e6de92e

Browse files
Localized handling
1 parent 1a74121 commit e6de92e

7 files changed

Lines changed: 168 additions & 82 deletions

File tree

.github/workflows/release.yml

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,39 @@ jobs:
4141
with:
4242
repository: 'golang/go'
4343
ref: ${{ matrix.buildtarget }}
44+
path: 'go'
45+
46+
- name: Download patch
47+
uses: actions/checkout@v6
48+
with:
49+
path: 'patch'
4450

4551
# Patches for Go 1.26.x before more minor changes introduces.
4652
- name: Apply patch
4753
run: |
48-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/unified-1-26-patch.diff | patch --verbose -p 1
54+
cd ./go
55+
patch --verbose -p 1 < ../patch/unified-1-26-patch.diff
56+
cd ..
4957
5058
- name: Set-up Go
5159
uses: actions/setup-go@v6
5260
with:
53-
go-version-file: 'src/go.mod'
61+
go-version-file: 'go/src/go.mod'
5462
check-latest: true
5563

5664
- name: Build patched Go
5765
shell: bash
5866
run: |
59-
cd ./src
67+
cd ./go/src
6068
. ./make.bash "$@" --no-banner
6169
../bin/go tool dist banner
62-
cd ..
70+
cd ../..
6371
6472
- name: Copy binaries into bin
6573
if: matrix.goos != 'linux' || matrix.goarch != 'amd64'
6674
shell: bash
6775
run: |
68-
cd ./bin
76+
cd ./go/bin
6977
DIR="${GOOS}_${GOARCH}"
7078
if [ -d "${DIR}" ]; then
7179
echo "Found ${DIR} copying binaries"
@@ -80,41 +88,45 @@ jobs:
8088
fi
8189
cd ..
8290
ls -al ./bin
91+
cd ..
8392
8493
- name: Copy License
8594
run: |
86-
rm ./LICENSE
87-
curl -O https://raw.githubusercontent.com/XTLS/go-win7/refs/heads/build/LICENSE
95+
cp -f ./patch/LICENSE ./go/
8896
8997
- name: Upload package to Artifacts
9098
uses: actions/upload-artifact@v7
9199
with:
92100
name: go-for-win7-${{ env.ASSET_NAME }}
93101
path: |
94-
./*
102+
./go/*
95103
96104
- name: create ZIP archive
97105
if: github.event_name == 'release'
98106
shell: bash
99107
run: |
108+
cd ./go/
100109
zip -9vr ./go-for-win7-${{ env.ASSET_NAME }}.zip . -x "./.*" "./.*/*" "./**/.*" "./**/.*/*" "./**/*_test.go" "./**/testdata"
110+
cd ../
101111
102112
- name: Compute hashes for file
103113
if: github.event_name == 'release'
104114
run: |
115+
cd ./go/
105116
FILE=./go-for-win7-${{ env.ASSET_NAME }}.zip
106117
DGST=$FILE.dgst
107118
for METHOD in {"md5","sha1","sha256","sha512"}
108119
do
109120
openssl dgst -$METHOD $FILE | sed 's/([^)]*)//g' >>$DGST
110121
done
122+
cd ../
111123
112124
- name: Upload packages to release
113125
uses: svenstaro/upload-release-action@v2
114126
if: github.event_name == 'release'
115127
with:
116128
repo_token: ${{ secrets.GITHUB_TOKEN }}
117-
file: ./go-for-win7-${{ env.ASSET_NAME }}.zip*
129+
file: ./go/go-for-win7-${{ env.ASSET_NAME }}.zip*
118130
tag: ${{ github.ref }}
119131
file_glob: true
120132

@@ -132,46 +144,57 @@ jobs:
132144
with:
133145
repository: 'golang/go'
134146
ref: ${{ matrix.buildtarget }}
147+
path: 'go'
148+
149+
- name: Download patch
150+
uses: actions/checkout@v6
151+
with:
152+
path: 'patch'
135153

136154
- name: Apply patch
137155
run: |
138-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/unified-1-26-patch.diff | patch --verbose -p 1
139-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/pre-KB3125574-1-26.diff | patch --verbose -p 1
156+
cd ./go
157+
patch --verbose -p 1 < ../patch/unified-1-26-patch.diff
158+
patch --verbose -p 1 < ../patch/pre-KB3125574-1-26.diff
159+
cd ..
140160
141161
- name: Copy License
142162
run: |
143-
rm ./LICENSE
144-
curl -O https://raw.githubusercontent.com/XTLS/go-win7/refs/heads/build/LICENSE
163+
cp -f ./patch/LICENSE ./go/
145164
146165
- name: Upload package to Artifacts
147166
uses: actions/upload-artifact@v7
148167
with:
149168
name: source-pre-KB3125574
150169
path: |
151-
./*
170+
./go/*
152171
153172
- name: create ZIP archive
154173
if: github.event_name == 'release'
155174
shell: bash
156175
run: |
176+
cd ./go/
157177
zip -9vr ./source-pre-KB3125574.zip . -x "./.*" "./.*/*" "./**/.*" "./**/.*/*" "./**/*_test.go"
178+
cd ..
158179
159180
- name: Compute hashes for file
160181
if: github.event_name == 'release'
161182
run: |
183+
cd ./go/
162184
FILE=./source-pre-KB3125574.zip
163185
DGST=$FILE.dgst
164186
for METHOD in {"md5","sha1","sha256","sha512"}
165187
do
166188
openssl dgst -$METHOD $FILE | sed 's/([^)]*)//g' >>$DGST
167189
done
190+
cd ../
168191
169192
- name: Upload packages to release
170193
uses: svenstaro/upload-release-action@v2
171194
if: github.event_name == 'release'
172195
with:
173196
repo_token: ${{ secrets.GITHUB_TOKEN }}
174-
file: ./source-pre-KB3125574.zip*
197+
file: ./go/source-pre-KB3125574.zip*
175198
tag: ${{ github.ref }}
176199
file_glob: true
177200

@@ -189,45 +212,56 @@ jobs:
189212
with:
190213
repository: 'golang/go'
191214
ref: ${{ matrix.buildtarget }}
215+
path: 'go'
216+
217+
- name: Download patch
218+
uses: actions/checkout@v6
219+
with:
220+
path: 'patch'
192221

193222
- name: Apply patch
194223
run: |
195-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/unified-1-26-patch.diff | patch --verbose -p 1
196-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/pre-SP1-1-26.diff | patch --verbose -p 1
224+
cd ./go
225+
patch --verbose -p 1 < ../patch/unified-1-26-patch.diff
226+
patch --verbose -p 1 < ../patch/pre-SP1-1-26.diff
227+
cd ..
197228
198229
- name: Copy License
199230
run: |
200-
rm ./LICENSE
201-
curl -O https://raw.githubusercontent.com/XTLS/go-win7/refs/heads/build/LICENSE
231+
cp -f ./patch/LICENSE ./go/
202232
203233
- name: Upload package to Artifacts
204234
uses: actions/upload-artifact@v7
205235
with:
206236
name: source-pre-SP1
207237
path: |
208-
./*
238+
./go/*
209239
210240
- name: create ZIP archive
211241
if: github.event_name == 'release'
212242
shell: bash
213243
run: |
244+
cd ./go/
214245
zip -9vr ./source-pre-SP1.zip . -x "./.*" "./.*/*" "./**/.*" "./**/.*/*" "./**/*_test.go"
246+
cd ../
215247
216248
- name: Compute hashes for file
217249
if: github.event_name == 'release'
218250
run: |
251+
cd ./go/
219252
FILE=./source-pre-SP1.zip
220253
DGST=$FILE.dgst
221254
for METHOD in {"md5","sha1","sha256","sha512"}
222255
do
223256
openssl dgst -$METHOD $FILE | sed 's/([^)]*)//g' >>$DGST
224257
done
258+
cd ../
225259
226260
- name: Upload packages to release
227261
uses: svenstaro/upload-release-action@v2
228262
if: github.event_name == 'release'
229263
with:
230264
repo_token: ${{ secrets.GITHUB_TOKEN }}
231-
file: ./source-pre-SP1.zip*
265+
file: ./go/source-pre-SP1.zip*
232266
tag: ${{ github.ref }}
233267
file_glob: true

.github/workflows/test-go1_22.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,39 @@ jobs:
4747
with:
4848
repository: 'golang/go'
4949
ref: ${{ matrix.buildtarget }}
50+
path: 'go'
51+
52+
- name: Download patch
53+
uses: actions/checkout@v6
54+
with:
55+
path: 'patch'
5056

5157
# Patches for Go 1.22.x before more minor changes introduces.
5258
- name: Apply patch
5359
run: |
54-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/unified-1-22-patch.diff | patch --verbose -p 1
55-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/e4701f06a6358bda901e72cbff44f414d902e988.diff | patch --verbose -p 1
56-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/41373f90356fd86e9cbe78c7a71c76066a6730c1.diff | patch --verbose -p 1
57-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/481cebf65c4052379cf3cda5db5588c48f2446f6.diff | patch --verbose -p 1
58-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/21d5caecf644a12d938c45f18e2b55f04b47f0b0.diff | patch --verbose -p 1
60+
cd ./go
61+
patch --verbose -p 1 < ../patch/unified-1-22-patch.diff
62+
cd ..
5963
6064
- name: Set-up Go
6165
uses: actions/setup-go@v6
6266
with:
63-
go-version-file: 'src/go.mod'
67+
go-version-file: 'go/src/go.mod'
6468
check-latest: true
6569

6670
- name: Build patched Go
6771
shell: bash
6872
run: |
69-
cd ./src
73+
cd ./go/src
7074
. ./make.bash "$@" --no-banner
7175
"$GOTOOLDIR/dist" banner
72-
cd ..
76+
cd ../..
7377
7478
- name: Copy binaries into bin
7579
if: matrix.goos != 'linux' || matrix.goarch != 'amd64'
7680
shell: bash
7781
run: |
78-
cd ./bin
82+
cd ./go/bin
7983
DIR="${GOOS}_${GOARCH}"
8084
if [ -d "${DIR}" ]; then
8185
echo "Found ${DIR} copying binaries"
@@ -90,10 +94,11 @@ jobs:
9094
fi
9195
cd ..
9296
ls -al ./bin
97+
cd ..
9398
9499
- name: Upload package to Artifacts
95100
uses: actions/upload-artifact@v7
96101
with:
97102
name: go-for-win7-${{ env.ASSET_NAME }}
98103
path: |
99-
./*
104+
./go/*

.github/workflows/test-go1_23.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,39 @@ jobs:
4747
with:
4848
repository: 'golang/go'
4949
ref: ${{ matrix.buildtarget }}
50+
path: 'go'
51+
52+
- name: Download patch
53+
uses: actions/checkout@v6
54+
with:
55+
path: 'patch'
5056

5157
# Patches for Go 1.23.x before more minor changes introduces.
5258
- name: Apply patch
5359
run: |
54-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/unified-1-23-patch.diff | patch --verbose -p 1
55-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/429f9a72007759a757c8e96a2763306c076dbb8f.diff | patch --verbose -p 1
56-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/ca03d8ed77dab8b91b69a9d44e6e56844fbcd5d8.diff | patch --verbose -p 1
57-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/719ab22f14443a88dd274f7a41afb86dd41628b1.diff | patch --verbose -p 1
58-
# curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/ac17c301268dd7835236e61c9bfefdf2b8e633d5.diff | patch --verbose -p 1
60+
cd ./go
61+
patch --verbose -p 1 < ../patch/unified-1-23-patch.diff
62+
cd ..
5963
6064
- name: Set-up Go
6165
uses: actions/setup-go@v6
6266
with:
63-
go-version-file: 'src/go.mod'
67+
go-version-file: 'go/src/go.mod'
6468
check-latest: true
6569

6670
- name: Build patched Go
6771
shell: bash
6872
run: |
69-
cd ./src
73+
cd ./go/src
7074
. ./make.bash "$@" --no-banner
7175
"$GOTOOLDIR/dist" banner
72-
cd ..
76+
cd ../..
7377
7478
- name: Copy binaries into bin
7579
if: matrix.goos != 'linux' || matrix.goarch != 'amd64'
7680
shell: bash
7781
run: |
78-
cd ./bin
82+
cd ./go/bin
7983
DIR="${GOOS}_${GOARCH}"
8084
if [ -d "${DIR}" ]; then
8185
echo "Found ${DIR} copying binaries"
@@ -90,10 +94,11 @@ jobs:
9094
fi
9195
cd ..
9296
ls -al ./bin
97+
cd ..
9398
9499
- name: Upload package to Artifacts
95100
uses: actions/upload-artifact@v7
96101
with:
97102
name: go-for-win7-${{ env.ASSET_NAME }}
98103
path: |
99-
./*
104+
./go/*

0 commit comments

Comments
 (0)