24
24
jobs :
25
25
bundle-artifacts :
26
26
runs-on : windows-latest
27
+ outputs :
28
+ latest-sdk64-extra-build-id : ${{ steps.determine-latest-sdk64-extra-build-id.outputs.id }}
27
29
steps :
28
30
- name : Configure user
29
31
shell : bash
@@ -34,15 +36,31 @@ jobs:
34
36
git config --global user.name "$USER_NAME" &&
35
37
git config --global user.email "$USER_EMAIL" &&
36
38
echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV
39
+ - name : Determine latest git-sdk-64-extra-artifacts build ID
40
+ id : determine-latest-sdk64-extra-build-id
41
+ shell : bash
42
+ run : |
43
+ urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
44
+ id=$(curl "$urlbase?definitions=29&statusFilter=completed&resultFilter=succeeded&\$top=1" |
45
+ jq -r '.value[0].id')
46
+
47
+ echo "Latest ID is ${id}"
48
+ echo "::set-output name=id::$id"
49
+ - name : Cache git-sdk-64-build-installers
50
+ id : cache-sdk-build-installers
51
+ uses : actions/cache@v2
52
+ with :
53
+ path : git-sdk-64-build-installers
54
+ key : build-installers-64-${{ steps.determine-latest-sdk64-extra-build-id.outputs.id }}
37
55
- name : Download git-sdk-64-build-installers
56
+ if : steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
38
57
shell : bash
39
58
run : |
40
59
# Use Git Bash to download and unpack the artifact
41
60
42
61
## Get artifact
43
62
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
44
- id=$(curl "$urlbase?definitions=29&statusFilter=completed&resultFilter=succeeded&\$top=1" |
45
- jq -r '.value[0].id')
63
+ id=${{ steps.determine-latest-sdk64-extra-build-id.outputs.id }}
46
64
download_url=$(curl "$urlbase/$id/artifacts" |
47
65
jq -r '.value[] | select(.name == "git-sdk-64-build-installers").resource.downloadUrl')
48
66
54
72
shell : bash
55
73
run : |
56
74
d=git-sdk-64-build-installers/usr/src/build-extra &&
57
- git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
75
+ if test ! -d $d/.git
76
+ then
77
+ git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
78
+ else
79
+ git -C $d fetch https://github.com/git-for-windows/build-extra main &&
80
+ git -C $d switch -C main FETCH_HEAD
81
+ fi
58
82
- name : Prepare home directory for GPG signing
59
83
if : env.GPGKEY != ''
60
84
shell : bash
@@ -104,6 +128,8 @@ jobs:
104
128
pkg :
105
129
runs-on : windows-latest
106
130
needs : bundle-artifacts
131
+ outputs :
132
+ latest-sdk64-extra-build-id : ${{ needs.bundle-artifacts.outputs.latest-sdk64-extra-build-id }}
107
133
strategy :
108
134
matrix :
109
135
arch :
@@ -264,8 +290,15 @@ jobs:
264
290
with :
265
291
name : bundle-artifacts
266
292
path : bundle-artifacts
267
- - name : Download git-sdk-64-build-installers
293
+ - name : Cache git-sdk-64-build-installers
268
294
if : env.SKIP != 'true' && matrix.arch.bitness == '64'
295
+ id : cache-sdk64-build-installers
296
+ uses : actions/cache@v2
297
+ with :
298
+ path : git-sdk-64-build-installers
299
+ key : build-installers-64-${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
300
+ - name : Download git-sdk-64-build-installers
301
+ if : env.SKIP != 'true' && matrix.arch.bitness == '64' && steps.cache-sdk64-build-installers.outputs.cache-hit != 'true'
269
302
shell : bash
270
303
run : |
271
304
# Use Git Bash to download and unpack the artifact
@@ -280,16 +313,33 @@ jobs:
280
313
281
314
## Unpack artifact
282
315
unzip artifacts.zip
283
- - name : Download git-sdk-32-build-installers
316
+ - name : Determine latest git-sdk-32-extra-artifacts build ID
284
317
if : env.SKIP != 'true' && matrix.arch.bitness == '32'
318
+ id : determine-latest-sdk32-extra-build-id
319
+ shell : bash
320
+ run : |
321
+ urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
322
+ id=$(curl "$urlbase?definitions=30&statusFilter=completed&resultFilter=succeeded&\$top=1" |
323
+ jq -r '.value[0].id')
324
+
325
+ echo "Latest ID is ${id}"
326
+ echo "::set-output name=id::$id"
327
+ - name : Cache git-sdk-32-build-installers
328
+ if : env.SKIP != 'true' && matrix.arch.bitness == '32'
329
+ id : cache-sdk32-build-installers
330
+ uses : actions/cache@v2
331
+ with :
332
+ path : git-sdk-32-build-installers
333
+ key : build-installers-32-${{ steps.determine-latest-sdk32-extra-build-id.outputs.id }}
334
+ - name : Download git-sdk-32-build-installers
335
+ if : env.SKIP != 'true' && matrix.arch.bitness == '32' && steps.cache-sdk32-build-installers.outputs.cache-hit != 'true'
285
336
shell : bash
286
337
run : |
287
338
# Use Git Bash to download and unpack the artifact
288
339
289
340
## Get artifact
290
341
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
291
- id=$(curl "$urlbase?definitions=30&statusFilter=completed&resultFilter=succeeded&\$top=1" |
292
- jq -r '.value[0].id')
342
+ id=${{ steps.determine-latest-sdk32-extra-build-id.outputs.id }}
293
343
download_url=$(curl "$urlbase/$id/artifacts" |
294
344
jq -r '.value[] | select(.name == "git-sdk-32-build-installers").resource.downloadUrl')
295
345
@@ -302,7 +352,13 @@ jobs:
302
352
shell : bash
303
353
run : |
304
354
d=git-sdk-${{matrix.arch.bitness}}-build-installers/usr/src/build-extra &&
305
- git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d &&
355
+ if test ! -d $d/.git
356
+ then
357
+ git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
358
+ else
359
+ git -C $d fetch https://github.com/git-for-windows/build-extra main &&
360
+ git -C $d switch -C main FETCH_HEAD
361
+ fi &&
306
362
git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main
307
363
- name : Prepare home directory for code-signing
308
364
env :
@@ -376,8 +432,15 @@ jobs:
376
432
with :
377
433
name : bundle-artifacts
378
434
path : bundle-artifacts
379
- - name : Download git-sdk-64-build-installers
435
+ - name : Cache git-sdk-64-build-installers
380
436
if : env.SKIP != 'true'
437
+ id : cache-sdk-build-installers
438
+ uses : actions/cache@v2
439
+ with :
440
+ path : git-sdk-64-build-installers
441
+ key : build-installers-64-${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
442
+ - name : Download git-sdk-64-build-installers
443
+ if : env.SKIP != 'true' && steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
381
444
shell : bash
382
445
run : |
383
446
# Use Git Bash to download and unpack the artifact
@@ -397,7 +460,13 @@ jobs:
397
460
shell : bash
398
461
run : |
399
462
d=git-sdk-64-build-installers/usr/src/build-extra &&
400
- git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d &&
463
+ if test ! -d $d/.git
464
+ then
465
+ git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
466
+ else
467
+ git -C $d fetch https://github.com/git-for-windows/build-extra main &&
468
+ git -C $d switch -C main FETCH_HEAD
469
+ fi &&
401
470
git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main
402
471
- uses : nuget/setup-nuget@v1
403
472
if : env.SKIP != 'true'
0 commit comments