@@ -3,13 +3,17 @@ name: git-artifacts
3
3
on :
4
4
# This workflow can be triggered manually in the Actions tab, see
5
5
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
6
- - workflow_dispatch
6
+ workflow_dispatch :
7
+ inputs :
8
+ build_only :
9
+ description : ' Optionally restrict what artifacts to build'
7
10
8
11
env :
9
12
GPG_OPTIONS : " --batch --yes --no-tty --list-options no-show-photos --verify-options no-show-photos --pinentry-mode loopback"
10
13
HOME : " ${{github.workspace}}\\ home"
11
14
MSYSTEM : MINGW64
12
15
USERPROFILE : " ${{github.workspace}}\\ home"
16
+ BUILD_ONLY : " ${{github.event.inputs.build_only}}"
13
17
14
18
jobs :
15
19
bundle-artifacts :
@@ -232,18 +236,28 @@ jobs:
232
236
env :
233
237
MSYSTEM : MINGW${{matrix.arch.bitness}}
234
238
steps :
239
+ - name : Determine whether this job should be skipped
240
+ shell : bash
241
+ run : |
242
+ case " $BUILD_ONLY " in
243
+ ' ') ;; # not set; build all
244
+ *" ${{matrix.artifact.name}} "*|*" ${{matrix.artifact.name}}-${{matrix.arch.name}} "*) ;; # build this artifact
245
+ *) echo "SKIP=true" >>$GITHUB_ENV;;
246
+ esac
235
247
- name : Download pkg-${{matrix.arch.name}}
248
+ if : env.SKIP != 'true'
236
249
uses : actions/download-artifact@v1
237
250
with :
238
251
name : pkg-${{matrix.arch.name}}
239
252
path : pkg-${{matrix.arch.name}}
240
253
- name : Download bundle-artifacts
254
+ if : env.SKIP != 'true'
241
255
uses : actions/download-artifact@v1
242
256
with :
243
257
name : bundle-artifacts
244
258
path : bundle-artifacts
245
259
- name : Download git-sdk-64-build-installers
246
- if : matrix.arch.bitness == '64'
260
+ if : env.SKIP != 'true' && matrix.arch.bitness == '64'
247
261
shell : bash
248
262
run : |
249
263
# Use Git Bash to download and unpack the artifact
@@ -259,7 +273,7 @@ jobs:
259
273
## Unpack artifact
260
274
unzip artifacts.zip
261
275
- name : Download git-sdk-32-build-installers
262
- if : matrix.arch.bitness == '32'
276
+ if : env.SKIP != 'true' && matrix.arch.bitness == '32'
263
277
shell : bash
264
278
run : |
265
279
# Use Git Bash to download and unpack the artifact
@@ -276,6 +290,7 @@ jobs:
276
290
## Unpack artifact
277
291
unzip artifacts.zip
278
292
- name : Clone and update build-extra
293
+ if : env.SKIP != 'true'
279
294
shell : bash
280
295
run : |
281
296
d=git-sdk-${{matrix.arch.bitness}}-build-installers/usr/src/build-extra &&
@@ -285,14 +300,15 @@ jobs:
285
300
env :
286
301
CODESIGN_P12 : ${{secrets.CODESIGN_P12}}
287
302
CODESIGN_PASS : ${{secrets.CODESIGN_PASS}}
288
- if : (matrix.artifact.name == 'installer' || matrix.artifact.name == 'portable') && env.CODESIGN_P12 != '' && env.CODESIGN_PASS != ''
303
+ if : env.SKIP != 'true' && (matrix.artifact.name == 'installer' || matrix.artifact.name == 'portable') && env.CODESIGN_P12 != '' && env.CODESIGN_PASS != ''
289
304
shell : bash
290
305
run : |
291
306
mkdir -p home/.sig &&
292
307
echo -n "$CODESIGN_P12" | tr % '\n' | base64 -d >home/.sig/codesign.p12 &&
293
308
echo -n "$CODESIGN_PASS" >home/.sig/codesign.pass &&
294
309
git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"'
295
310
- name : Build ${{matrix.arch.bitness}}-bit ${{matrix.artifact.name}}
311
+ if : env.SKIP != 'true'
296
312
shell : powershell
297
313
run : |
298
314
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
@@ -305,7 +321,7 @@ jobs:
305
321
openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed \"s/.* //\" >artifacts/sha-256.txt
306
322
"@
307
323
- name : Copy package-versions and pdbs
308
- if : matrix.artifact.name == 'installer'
324
+ if : env.SKIP != 'true' && matrix.artifact.name == 'installer'
309
325
shell : powershell
310
326
run : |
311
327
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
@@ -319,10 +335,11 @@ jobs:
319
335
GIT_CONFIG_PARAMETERS=\"'windows.sdk${{matrix.arch.bitness}}.path='\" ./please.sh bundle_pdbs --arch=${{matrix.arch.name}} --directory=\"`$a\" installer/package-versions.txt)
320
336
"@
321
337
- name : Clean up temporary files
322
- if : always()
338
+ if : always() && env.SKIP != 'true'
323
339
shell : bash
324
340
run : rm -rf home
325
341
- name : Publish ${{matrix.artifact.name}}-${{matrix.arch.name}}
342
+ if : env.SKIP != 'true'
326
343
uses : actions/upload-artifact@v1
327
344
with :
328
345
name : ${{matrix.artifact.name}}-${{matrix.arch.name}}
@@ -331,17 +348,28 @@ jobs:
331
348
runs-on : windows-latest
332
349
needs : pkg
333
350
steps :
351
+ - name : Determine whether this job should be skipped
352
+ shell : bash
353
+ run : |
354
+ case " $BUILD_ONLY " in
355
+ ' ') ;; # not set; build all
356
+ *" nuget "*) ;; # build this artifact
357
+ *) echo "SKIP=true" >>$GITHUB_ENV;;
358
+ esac
334
359
- name : Download pkg-x86_64
360
+ if : env.SKIP != 'true'
335
361
uses : actions/download-artifact@v1
336
362
with :
337
363
name : pkg-x86_64
338
364
path : pkg-x86_64
339
365
- name : Download bundle-artifacts
366
+ if : env.SKIP != 'true'
340
367
uses : actions/download-artifact@v1
341
368
with :
342
369
name : bundle-artifacts
343
370
path : bundle-artifacts
344
371
- name : Download git-sdk-64-build-installers
372
+ if : env.SKIP != 'true'
345
373
shell : bash
346
374
run : |
347
375
# Use Git Bash to download and unpack the artifact
@@ -357,13 +385,16 @@ jobs:
357
385
## Unpack artifact
358
386
unzip artifacts.zip
359
387
- name : Clone and update build-extra
388
+ if : env.SKIP != 'true'
360
389
shell : bash
361
390
run : |
362
391
d=git-sdk-64-build-installers/usr/src/build-extra &&
363
392
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d &&
364
393
git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main
365
394
- uses : nuget/setup-nuget@v1
395
+ if : env.SKIP != 'true'
366
396
- name : Build 64-bit NuGet packages
397
+ if : env.SKIP != 'true'
367
398
shell : powershell
368
399
run : |
369
400
& .\git-sdk-64-build-installers\usr\bin\bash.exe -lc @"
@@ -372,6 +403,7 @@ jobs:
372
403
openssl dgst -sha256 artifacts/Git*.nupkg | sed \"s/.* //\" >artifacts/sha-256.txt
373
404
"@
374
405
- name : Publish nuget-x86_64
406
+ if : env.SKIP != 'true'
375
407
uses : actions/upload-artifact@v1
376
408
with :
377
409
name : nuget-x86_64
0 commit comments