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 :
@@ -262,8 +288,15 @@ jobs:
262
288
with :
263
289
name : bundle-artifacts
264
290
path : bundle-artifacts
265
- - name : Download git-sdk-64-build-installers
291
+ - name : Cache git-sdk-64-build-installers
266
292
if : env.SKIP != 'true' && matrix.arch.bitness == '64'
293
+ id : cache-sdk64-build-installers
294
+ uses : actions/cache@v2
295
+ with :
296
+ path : git-sdk-64-build-installers
297
+ key : build-installers-64-${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
298
+ - name : Download git-sdk-64-build-installers
299
+ if : env.SKIP != 'true' && matrix.arch.bitness == '64' && steps.cache-sdk64-build-installers.outputs.cache-hit != 'true'
267
300
shell : bash
268
301
run : |
269
302
# Use Git Bash to download and unpack the artifact
@@ -278,16 +311,33 @@ jobs:
278
311
279
312
## Unpack artifact
280
313
unzip artifacts.zip
281
- - name : Download git-sdk-32-build-installers
314
+ - name : Determine latest git-sdk-32-extra-artifacts build ID
282
315
if : env.SKIP != 'true' && matrix.arch.bitness == '32'
316
+ id : determine-latest-sdk32-extra-build-id
317
+ shell : bash
318
+ run : |
319
+ urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
320
+ id=$(curl "$urlbase?definitions=30&statusFilter=completed&resultFilter=succeeded&\$top=1" |
321
+ jq -r '.value[0].id')
322
+
323
+ echo "Latest ID is ${id}"
324
+ echo "::set-output name=id::$id"
325
+ - name : Cache git-sdk-32-build-installers
326
+ if : env.SKIP != 'true' && matrix.arch.bitness == '32'
327
+ id : cache-sdk32-build-installers
328
+ uses : actions/cache@v2
329
+ with :
330
+ path : git-sdk-32-build-installers
331
+ key : build-installers-32-${{ steps.determine-latest-sdk32-extra-build-id.outputs.id }}
332
+ - name : Download git-sdk-32-build-installers
333
+ if : env.SKIP != 'true' && matrix.arch.bitness == '32' && steps.cache-sdk32-build-installers.outputs.cache-hit != 'true'
283
334
shell : bash
284
335
run : |
285
336
# Use Git Bash to download and unpack the artifact
286
337
287
338
## Get artifact
288
339
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
289
- id=$(curl "$urlbase?definitions=30&statusFilter=completed&resultFilter=succeeded&\$top=1" |
290
- jq -r '.value[0].id')
340
+ id=${{ steps.determine-latest-sdk32-extra-build-id.outputs.id }}
291
341
download_url=$(curl "$urlbase/$id/artifacts" |
292
342
jq -r '.value[] | select(.name == "git-sdk-32-build-installers").resource.downloadUrl')
293
343
@@ -300,7 +350,13 @@ jobs:
300
350
shell : bash
301
351
run : |
302
352
d=git-sdk-${{matrix.arch.bitness}}-build-installers/usr/src/build-extra &&
303
- git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d &&
353
+ if test ! -d $d/.git
354
+ then
355
+ git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
356
+ else
357
+ git -C $d fetch https://github.com/git-for-windows/build-extra main &&
358
+ git -C $d switch -C main FETCH_HEAD
359
+ fi &&
304
360
git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main
305
361
- name : Prepare home directory for code-signing
306
362
env :
@@ -374,8 +430,15 @@ jobs:
374
430
with :
375
431
name : bundle-artifacts
376
432
path : bundle-artifacts
377
- - name : Download git-sdk-64-build-installers
433
+ - name : Cache git-sdk-64-build-installers
378
434
if : env.SKIP != 'true'
435
+ id : cache-sdk-build-installers
436
+ uses : actions/cache@v2
437
+ with :
438
+ path : git-sdk-64-build-installers
439
+ key : build-installers-64-${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
440
+ - name : Download git-sdk-64-build-installers
441
+ if : env.SKIP != 'true' && steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
379
442
shell : bash
380
443
run : |
381
444
# Use Git Bash to download and unpack the artifact
@@ -395,7 +458,13 @@ jobs:
395
458
shell : bash
396
459
run : |
397
460
d=git-sdk-64-build-installers/usr/src/build-extra &&
398
- git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d &&
461
+ if test ! -d $d/.git
462
+ then
463
+ git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
464
+ else
465
+ git -C $d fetch https://github.com/git-for-windows/build-extra main &&
466
+ git -C $d switch -C main FETCH_HEAD
467
+ fi &&
399
468
git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main
400
469
- uses : nuget/setup-nuget@v1
401
470
if : env.SKIP != 'true'
0 commit comments