@@ -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
0 commit comments