@@ -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 :
@@ -230,18 +234,28 @@ jobs:
230
234
env :
231
235
MSYSTEM : MINGW${{matrix.arch.bitness}}
232
236
steps :
237
+ - name : Determine whether this job should be skipped
238
+ shell : bash
239
+ run : |
240
+ case " $BUILD_ONLY " in
241
+ ' ') ;; # not set; build all
242
+ *" ${{matrix.artifact.name}} "*|*" ${{matrix.artifact.name}}-${{matrix.arch.name}} "*) ;; # build this artifact
243
+ *) echo "SKIP=true" >>$GITHUB_ENV;;
244
+ esac
233
245
- name : Download pkg-${{matrix.arch.name}}
246
+ if : env.SKIP != 'true'
234
247
uses : actions/download-artifact@v1
235
248
with :
236
249
name : pkg-${{matrix.arch.name}}
237
250
path : pkg-${{matrix.arch.name}}
238
251
- name : Download bundle-artifacts
252
+ if : env.SKIP != 'true'
239
253
uses : actions/download-artifact@v1
240
254
with :
241
255
name : bundle-artifacts
242
256
path : bundle-artifacts
243
257
- name : Download git-sdk-64-build-installers
244
- if : matrix.arch.bitness == '64'
258
+ if : env.SKIP != 'true' && matrix.arch.bitness == '64'
245
259
shell : bash
246
260
run : |
247
261
# Use Git Bash to download and unpack the artifact
@@ -257,7 +271,7 @@ jobs:
257
271
## Unpack artifact
258
272
unzip artifacts.zip
259
273
- name : Download git-sdk-32-build-installers
260
- if : matrix.arch.bitness == '32'
274
+ if : env.SKIP != 'true' && matrix.arch.bitness == '32'
261
275
shell : bash
262
276
run : |
263
277
# Use Git Bash to download and unpack the artifact
@@ -274,6 +288,7 @@ jobs:
274
288
## Unpack artifact
275
289
unzip artifacts.zip
276
290
- name : Clone and update build-extra
291
+ if : env.SKIP != 'true'
277
292
shell : bash
278
293
run : |
279
294
d=git-sdk-${{matrix.arch.bitness}}-build-installers/usr/src/build-extra &&
@@ -283,14 +298,15 @@ jobs:
283
298
env :
284
299
CODESIGN_P12 : ${{secrets.CODESIGN_P12}}
285
300
CODESIGN_PASS : ${{secrets.CODESIGN_PASS}}
286
- if : (matrix.artifact.name == 'installer' || matrix.artifact.name == 'portable') && env.CODESIGN_P12 != '' && env.CODESIGN_PASS != ''
301
+ if : env.SKIP != 'true' && (matrix.artifact.name == 'installer' || matrix.artifact.name == 'portable') && env.CODESIGN_P12 != '' && env.CODESIGN_PASS != ''
287
302
shell : bash
288
303
run : |
289
304
mkdir -p home/.sig &&
290
305
echo -n "$CODESIGN_P12" | tr % '\n' | base64 -d >home/.sig/codesign.p12 &&
291
306
echo -n "$CODESIGN_PASS" >home/.sig/codesign.pass &&
292
307
git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"'
293
308
- name : Build ${{matrix.arch.bitness}}-bit ${{matrix.artifact.name}}
309
+ if : env.SKIP != 'true'
294
310
shell : powershell
295
311
run : |
296
312
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
@@ -303,7 +319,7 @@ jobs:
303
319
openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed \"s/.* //\" >artifacts/sha-256.txt
304
320
"@
305
321
- name : Copy package-versions and pdbs
306
- if : matrix.artifact.name == 'installer'
322
+ if : env.SKIP != 'true' && matrix.artifact.name == 'installer'
307
323
shell : powershell
308
324
run : |
309
325
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
@@ -317,10 +333,11 @@ jobs:
317
333
GIT_CONFIG_PARAMETERS=\"'windows.sdk${{matrix.arch.bitness}}.path='\" ./please.sh bundle_pdbs --arch=${{matrix.arch.name}} --directory=\"`$a\" installer/package-versions.txt)
318
334
"@
319
335
- name : Clean up temporary files
320
- if : always()
336
+ if : always() && env.SKIP != 'true'
321
337
shell : bash
322
338
run : rm -rf home
323
339
- name : Publish ${{matrix.artifact.name}}-${{matrix.arch.name}}
340
+ if : env.SKIP != 'true'
324
341
uses : actions/upload-artifact@v1
325
342
with :
326
343
name : ${{matrix.artifact.name}}-${{matrix.arch.name}}
@@ -329,17 +346,28 @@ jobs:
329
346
runs-on : windows-latest
330
347
needs : pkg
331
348
steps :
349
+ - name : Determine whether this job should be skipped
350
+ shell : bash
351
+ run : |
352
+ case " $BUILD_ONLY " in
353
+ ' ') ;; # not set; build all
354
+ *" nuget "*) ;; # build this artifact
355
+ *) echo "SKIP=true" >>$GITHUB_ENV;;
356
+ esac
332
357
- name : Download pkg-x86_64
358
+ if : env.SKIP != 'true'
333
359
uses : actions/download-artifact@v1
334
360
with :
335
361
name : pkg-x86_64
336
362
path : pkg-x86_64
337
363
- name : Download bundle-artifacts
364
+ if : env.SKIP != 'true'
338
365
uses : actions/download-artifact@v1
339
366
with :
340
367
name : bundle-artifacts
341
368
path : bundle-artifacts
342
369
- name : Download git-sdk-64-build-installers
370
+ if : env.SKIP != 'true'
343
371
shell : bash
344
372
run : |
345
373
# Use Git Bash to download and unpack the artifact
@@ -355,13 +383,16 @@ jobs:
355
383
## Unpack artifact
356
384
unzip artifacts.zip
357
385
- name : Clone and update build-extra
386
+ if : env.SKIP != 'true'
358
387
shell : bash
359
388
run : |
360
389
d=git-sdk-64-build-installers/usr/src/build-extra &&
361
390
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d &&
362
391
git -C $d pull "$PWD"/bundle-artifacts/build-extra.bundle main
363
392
- uses : nuget/setup-nuget@v1
393
+ if : env.SKIP != 'true'
364
394
- name : Build 64-bit NuGet packages
395
+ if : env.SKIP != 'true'
365
396
shell : powershell
366
397
run : |
367
398
& .\git-sdk-64-build-installers\usr\bin\bash.exe -lc @"
@@ -370,6 +401,7 @@ jobs:
370
401
openssl dgst -sha256 artifacts/Git*.nupkg | sed \"s/.* //\" >artifacts/sha-256.txt
371
402
"@
372
403
- name : Publish nuget-x86_64
404
+ if : env.SKIP != 'true'
373
405
uses : actions/upload-artifact@v1
374
406
with :
375
407
name : nuget-x86_64
0 commit comments