@@ -39,42 +39,13 @@ jobs:
39
39
git config --global user.name "$USER_NAME" &&
40
40
git config --global user.email "$USER_EMAIL" &&
41
41
echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV
42
- - name : Determine latest git-sdk-64-extra-artifacts build ID
43
- id : determine-latest-sdk64-extra-build-id
44
- shell : bash
45
- run : |
46
- urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
47
- id=$(curl "$urlbase?definitions=29&statusFilter=completed&resultFilter=succeeded&\$top=1" |
48
- jq -r '.value[0].id')
49
-
50
- echo "Latest ID is ${id}"
51
- echo "::set-output name=id::$id"
52
- - name : Cache git-sdk-64-build-installers
53
- id : cache-sdk-build-installers
54
- uses : actions/cache@v2
42
+ - uses : git-for-windows/setup-git-for-windows-sdk@v0
55
43
with :
56
- path : git-sdk-64-build-installers
57
- key : build-installers-64-${{ steps.determine-latest-sdk64-extra-build-id.outputs.id }}
58
- - name : Download git-sdk-64-build-installers
59
- if : steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
60
- shell : bash
61
- run : |
62
- # Use Git Bash to download and unpack the artifact
63
-
64
- ## Get artifact
65
- urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
66
- id=${{ steps.determine-latest-sdk64-extra-build-id.outputs.id }}
67
- download_url=$(curl "$urlbase/$id/artifacts" |
68
- jq -r '.value[] | select(.name == "git-sdk-64-build-installers").resource.downloadUrl')
69
-
70
- curl -o artifacts.zip "$download_url"
71
-
72
- ## Unpack artifact
73
- unzip artifacts.zip
44
+ flavor : build-installers
74
45
- name : Clone build-extra
75
46
shell : bash
76
47
run : |
77
- d=git-sdk-64-build-installers /usr/src/build-extra &&
48
+ d=/usr/src/build-extra &&
78
49
if test ! -d $d/.git
79
50
then
80
51
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
88
59
run : |
89
60
echo '${{secrets.PRIVGPGKEY}}' | tr % '\n' | gpg $GPG_OPTIONS --import &&
90
61
mkdir -p home &&
91
- git config --global gpg.program "$PWD/git-sdk-64-build-installers /usr/src/build-extra/gnupg-with-gpgkey.sh" &&
62
+ git config --global gpg.program "/usr/src/build-extra/gnupg-with-gpgkey.sh" &&
92
63
info="$(gpg --list-keys --with-colons "${GPGKEY%% *}" | cut -d : -f 1,10 | sed -n '/^uid/{s|uid:||p;q}')" &&
93
64
git config --global user.name "${info% <*}" &&
94
65
git config --global user.email "<${info#*<}"
@@ -97,28 +68,26 @@ jobs:
97
68
- name : Generate bundle artifacts
98
69
env :
99
70
GPGKEY : ${{secrets.GPGKEY}}
100
- shell : powershell
71
+ shell : bash
101
72
run : |
102
- & .\git-sdk-64-build-installers\git-cmd.exe --command=usr\bin\bash.exe -lc @"
103
- printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "`$@"\n' >/usr/bin/git &&
104
- mkdir -p bundle-artifacts &&
73
+ printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "$@"\n' >/usr/bin/git &&
74
+ mkdir -p bundle-artifacts &&
105
75
106
- { test -n \"` $REPOSITORY\ " || REPOSITORY='${{github.repository}}'; } &&
107
- { test -n \"` $REF\ " || REF='${{github.ref}}'; } &&
108
- git -c init.defaultBranch=main init --bare &&
109
- git remote add -f origin https://github.com/git-for-windows/git &&
110
- git fetch \ "https://github.com/` $REPOSITORY\" \"` $REF:` $REF\ " &&
76
+ { test -n " $REPOSITORY" || REPOSITORY='${{github.repository}}'; } &&
77
+ { test -n " $REF" || REF='${{github.ref}}'; } &&
78
+ git -c init.defaultBranch=main init --bare &&
79
+ git remote add -f origin https://github.com/git-for-windows/git &&
80
+ git fetch "https://github.com/$REPOSITORY" " $REF:$REF" &&
111
81
112
- tag_name=\"` $(git describe --match 'v[0-9]*' FETCH_HEAD)-` $(date +%Y%m%d%H%M%S)\ " &&
113
- echo \ "prerelease-` ${tag_name#v}\ " >bundle-artifacts/ver &&
114
- echo \"` ${tag_name#v}\ " >bundle-artifacts/display_version &&
115
- echo \"` $tag_name\ " >bundle-artifacts/next_version &&
116
- git tag ` $(test -z \"` $GPGKEY\ " || echo \ " -s\ ") -m \ "Snapshot build\" \"` $tag_name\ " FETCH_HEAD &&
117
- git bundle create bundle-artifacts/git.bundle origin/main..\"` $tag_name\ " &&
82
+ tag_name=" $(git describe --match 'v[0-9]*' FETCH_HEAD)-$(date +%Y%m%d%H%M%S)" &&
83
+ echo "prerelease-${tag_name#v}" >bundle-artifacts/ver &&
84
+ echo " ${tag_name#v}" >bundle-artifacts/display_version &&
85
+ echo " $tag_name" >bundle-artifacts/next_version &&
86
+ git tag $(test -z " $GPGKEY" || echo " -s") -m "Snapshot build" " $tag_name" FETCH_HEAD &&
87
+ git bundle create bundle-artifacts/git.bundle origin/main.." $tag_name" &&
118
88
119
- sh -x /usr/src/build-extra/please.sh mention feature \"Snapshot of `$(git show -s --pretty='tformat:%h (%s, %ad)' --date=short FETCH_HEAD)\" &&
120
- git -C /usr/src/build-extra bundle create \"`$PWD/bundle-artifacts/build-extra.bundle\" origin/main..main
121
- "@
89
+ sh -x /usr/src/build-extra/please.sh mention feature "Snapshot of $(git show -s --pretty='tformat:%h (%s, %ad)' --date=short FETCH_HEAD)" &&
90
+ git -C /usr/src/build-extra bundle create "$PWD/bundle-artifacts/build-extra.bundle" origin/main..main
122
91
- name : Clean up temporary files
123
92
if : always()
124
93
shell : bash
@@ -166,29 +135,10 @@ jobs:
166
135
git config --global user.name "$USER_NAME" &&
167
136
git config --global user.email "$USER_EMAIL" &&
168
137
echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV
169
- - name : Cache git-sdk-64-build-installers
138
+ - uses : git-for-windows/setup-git-for-windows-sdk@v0
170
139
if : env.SKIP != 'true'
171
- id : cache-sdk-build-installers
172
- uses : actions/cache@v2
173
140
with :
174
- path : git-sdk-64-build-installers
175
- key : build-installers-64-${{ needs.bundle-artifacts.outputs.latest-sdk64-extra-build-id }}
176
- - name : Download git-sdk-64-build-installers
177
- if : env.SKIP != 'true' && steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
178
- shell : bash
179
- run : |
180
- # Use Git Bash to download and unpack the artifact
181
-
182
- ## Get artifact
183
- urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
184
- id=${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
185
- download_url=$(curl "$urlbase/$id/artifacts" |
186
- jq -r '.value[] | select(.name == "git-sdk-64-build-installers").resource.downloadUrl')
187
-
188
- curl -o artifacts.zip "$download_url"
189
-
190
- ## Unpack artifact
191
- unzip artifacts.zip
141
+ flavor : build-installers
192
142
- name : Download bundle-artifacts
193
143
if : env.SKIP != 'true'
194
144
uses : actions/download-artifact@v1
@@ -199,7 +149,7 @@ jobs:
199
149
if : env.SKIP != 'true'
200
150
shell : bash
201
151
run : |
202
- d=git-sdk-64-build-installers /usr/src/build-extra &&
152
+ d=/usr/src/build-extra &&
203
153
if test ! -d $d/.git
204
154
then
205
155
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
@@ -242,32 +192,33 @@ jobs:
242
192
if : env.SKIP != 'true'
243
193
env :
244
194
GPGKEY : " ${{secrets.GPGKEY}}"
245
- shell : powershell
195
+ shell : bash
246
196
run : |
247
- & git-sdk-64-build-installers\usr\bin\sh.exe -lc @"
248
- set -x
197
+ set -x
249
198
250
- # Restrict `PATH` to MSYS2 and to Visual Studio (to let `cv2pdb` find the relevant DLLs)
251
- PATH=\"` /mingw64/bin:/usr/bin:/C/Program Files (x86)/Microsoft Visual Studio 14.0/VC/ bin${{matrix.arch.bin}}:/C/Windows/system32\"
199
+ # Make sure that there is a `/usr/bin/git` that can be used by `makepkg-mingw`
200
+ printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "$@"\n' >/usr/ bin/git &&
252
201
253
- type -p mspdb140.dll || exit 1
254
- sh -x /usr/src/build-extra/please.sh build-mingw-w64-git --only-${{matrix.arch.bitness}}-bit --build-src-pkg -o artifacts HEAD &&
255
- cp bundle-artifacts/ver artifacts/ &&
256
- if test -n \"`$GPGKEY\"
257
- then
258
- for tar in artifacts/*.tar*
259
- do
260
- /usr/src/build-extra/gnupg-with-gpgkey.sh --detach-sign --no-armor `$tar
261
- done
262
- fi &&
202
+ # Restrict `PATH` to MSYS2 and to Visual Studio (to let `cv2pdb` find the relevant DLLs)
203
+ PATH="/mingw64/bin:/usr/bin:/C/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin${{matrix.arch.bin}}:/C/Windows/system32"
263
204
264
- b=`$PWD/artifacts &&
265
- version=`$(cat bundle-artifacts/next_version) &&
266
- (cd /usr/src/MINGW-packages/mingw-w64-git &&
267
- cp PKGBUILD.`$version PKGBUILD &&
268
- git commit -s -m \"mingw-w64-git: new version (`$version)\" PKGBUILD &&
269
- git bundle create \"`$b\"/MINGW-packages.bundle origin/main..main)
270
- "@
205
+ type -p mspdb140.dll || exit 1
206
+ sh -x /usr/src/build-extra/please.sh build-mingw-w64-git --only-${{matrix.arch.bitness}}-bit --build-src-pkg -o artifacts HEAD &&
207
+ cp bundle-artifacts/ver artifacts/ &&
208
+ if test -n "$GPGKEY"
209
+ then
210
+ for tar in artifacts/*.tar*
211
+ do
212
+ /usr/src/build-extra/gnupg-with-gpgkey.sh --detach-sign --no-armor $tar
213
+ done
214
+ fi &&
215
+
216
+ b=$PWD/artifacts &&
217
+ version=$(cat bundle-artifacts/next_version) &&
218
+ (cd /usr/src/MINGW-packages/mingw-w64-git &&
219
+ cp PKGBUILD.$version PKGBUILD &&
220
+ git commit -s -m "mingw-w64-git: new version ($version)" PKGBUILD &&
221
+ git bundle create "$b"/MINGW-packages.bundle origin/main..main)
271
222
- name : Clean up temporary files
272
223
if : always() && env.SKIP != 'true'
273
224
shell : bash
@@ -417,63 +368,15 @@ jobs:
417
368
with :
418
369
name : bundle-artifacts
419
370
path : bundle-artifacts
420
- - name : Cache git-sdk-64-build-installers
371
+ - uses : git-for-windows/setup-git-for-windows-sdk@v0
421
372
if : env.SKIP != 'true' && matrix.arch.bitness == '64'
422
- id : cache-sdk64-build-installers
423
- uses : actions/cache@v2
424
373
with :
425
- path : git-sdk-64-build-installers
426
- key : build-installers-64-${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
427
- - name : Download git-sdk-64-build-installers
428
- if : env.SKIP != 'true' && matrix.arch.bitness == '64' && steps.cache-sdk64-build-installers.outputs.cache-hit != 'true'
429
- shell : bash
430
- run : |
431
- # Use Git Bash to download and unpack the artifact
432
-
433
- ## Get artifact
434
- urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
435
- id=${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
436
- download_url="$(curl "$urlbase/$id/artifacts" |
437
- jq -r '.value[] | select(.name == "git-sdk-64-build-installers").resource.downloadUrl')"
438
-
439
- curl -o artifacts.zip "$download_url"
440
-
441
- ## Unpack artifact
442
- unzip artifacts.zip
443
- - name : Determine latest git-sdk-32-extra-artifacts build ID
374
+ flavor : build-installers
375
+ - uses : git-for-windows/setup-git-for-windows-sdk@v0
444
376
if : env.SKIP != 'true' && matrix.arch.bitness == '32'
445
- id : determine-latest-sdk32-extra-build-id
446
- shell : bash
447
- run : |
448
- urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
449
- id=$(curl "$urlbase?definitions=30&statusFilter=completed&resultFilter=succeeded&\$top=1" |
450
- jq -r '.value[0].id')
451
-
452
- echo "Latest ID is ${id}"
453
- echo "::set-output name=id::$id"
454
- - name : Cache git-sdk-32-build-installers
455
- if : env.SKIP != 'true' && matrix.arch.bitness == '32'
456
- id : cache-sdk32-build-installers
457
- uses : actions/cache@v2
458
377
with :
459
- path : git-sdk-32-build-installers
460
- key : build-installers-32-${{ steps.determine-latest-sdk32-extra-build-id.outputs.id }}
461
- - name : Download git-sdk-32-build-installers
462
- if : env.SKIP != 'true' && matrix.arch.bitness == '32' && steps.cache-sdk32-build-installers.outputs.cache-hit != 'true'
463
- shell : bash
464
- run : |
465
- # Use Git Bash to download and unpack the artifact
466
-
467
- ## Get artifact
468
- urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
469
- id=${{ steps.determine-latest-sdk32-extra-build-id.outputs.id }}
470
- download_url=$(curl "$urlbase/$id/artifacts" |
471
- jq -r '.value[] | select(.name == "git-sdk-32-build-installers").resource.downloadUrl')
472
-
473
- curl -o artifacts.zip "$download_url"
474
-
475
- ## Unpack artifact
476
- unzip artifacts.zip
378
+ flavor : build-installers
379
+ architecture : i686
477
380
- name : Download arm64 artifact
478
381
if : env.SKIP != 'true' && matrix.arch.arm64 == true
479
382
uses : actions/download-artifact@v1
@@ -484,7 +387,7 @@ jobs:
484
387
if : env.SKIP != 'true'
485
388
shell : bash
486
389
run : |
487
- d=git-sdk-${{matrix.arch.bitness}}-build-installers /usr/src/build-extra &&
390
+ d=/usr/src/build-extra &&
488
391
if test ! -d $d/.git
489
392
then
490
393
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
@@ -506,38 +409,34 @@ jobs:
506
409
git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"'
507
410
- name : Build ${{matrix.arch.bitness}}-bit ${{matrix.artifact.name}}
508
411
if : env.SKIP != 'true'
509
- shell : powershell
412
+ shell : bash
510
413
run : |
511
- & .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
512
- set -x
513
- if test "${{matrix.arch.arm64}}" = true
514
- then
515
- ARM64="--include-arm64-artifacts=\"$PWD/arm64\""
516
- else
517
- ARM64=
518
- fi
414
+ set -x
415
+ if test "${{matrix.arch.arm64}}" = true
416
+ then
417
+ ARM64="--include-arm64-artifacts=\"$PWD/arm64\""
418
+ else
419
+ ARM64=
420
+ fi
519
421
520
- eval /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git `$ARM64 --version=`$(cat pkg-${{matrix.arch.name}}/ver) -o artifacts --${{matrix.artifact.name}} --pkg=pkg-${{matrix.arch.name}}/mingw-w64-${{matrix.arch.name}}-git-[0-9]*.tar.xz --pkg=pkg-${{matrix.arch.name}}/mingw-w64-${{matrix.arch.name}}-git-doc-html-[0-9]*.tar.xz &&
521
- if test portable = '${{matrix.artifact.name}}' && test -n \"`$(git config alias.signtool)\"
522
- then
523
- git signtool artifacts/PortableGit-*.exe
524
- fi &&
525
- openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed \"s/.* //\" >artifacts/sha-256.txt
526
- "@
422
+ eval /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git $ARM64 --version=$(cat pkg-${{matrix.arch.name}}/ver) -o artifacts --${{matrix.artifact.name}} --pkg=pkg-${{matrix.arch.name}}/mingw-w64-${{matrix.arch.name}}-git-[0-9]*.tar.xz --pkg=pkg-${{matrix.arch.name}}/mingw-w64-${{matrix.arch.name}}-git-doc-html-[0-9]*.tar.xz &&
423
+ if test portable = '${{matrix.artifact.name}}' && test -n "$(git config alias.signtool)"
424
+ then
425
+ git signtool artifacts/PortableGit-*.exe
426
+ fi &&
427
+ openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed "s/.* //" >artifacts/sha-256.txt
527
428
- name : Copy package-versions and pdbs
528
429
if : env.SKIP != 'true' && matrix.artifact.name == 'installer'
529
- shell : powershell
430
+ shell : bash
530
431
run : |
531
- & .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
532
- cp /usr/src/build-extra/installer/package-versions.txt artifacts/ &&
432
+ cp /usr/src/build-extra/installer/package-versions.txt artifacts/ &&
533
433
534
- a=`$PWD/artifacts &&
535
- p=`$PWD/pkg-${{matrix.arch.name}} &&
536
- (cd /usr/src/build-extra &&
537
- mkdir -p cached-source-packages &&
538
- cp \"`$p\"/*-pdb* cached-source-packages/ &&
539
- GIT_CONFIG_PARAMETERS=\"'windows.sdk${{matrix.arch.bitness}}.path='\" ./please.sh bundle_pdbs --arch=${{matrix.arch.name}} --directory=\"`$a\" installer/package-versions.txt)
540
- "@
434
+ a=$PWD/artifacts &&
435
+ p=$PWD/pkg-${{matrix.arch.name}} &&
436
+ (cd /usr/src/build-extra &&
437
+ mkdir -p cached-source-packages &&
438
+ cp "$p"/*-pdb* cached-source-packages/ &&
439
+ GIT_CONFIG_PARAMETERS="'windows.sdk${{matrix.arch.bitness}}.path='" ./please.sh bundle_pdbs --arch=${{matrix.arch.name}} --directory="$a" installer/package-versions.txt)
541
440
- name : Clean up temporary files
542
441
if : always() && env.SKIP != 'true'
543
442
shell : bash
@@ -578,34 +477,15 @@ jobs:
578
477
with :
579
478
name : bundle-artifacts
580
479
path : bundle-artifacts
581
- - name : Cache git-sdk-64-build-installers
480
+ - uses : git-for-windows/setup-git-for-windows-sdk@v0
582
481
if : env.SKIP != 'true'
583
- id : cache-sdk-build-installers
584
- uses : actions/cache@v2
585
482
with :
586
- path : git-sdk-64-build-installers
587
- key : build-installers-64-${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
588
- - name : Download git-sdk-64-build-installers
589
- if : env.SKIP != 'true' && steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
590
- shell : bash
591
- run : |
592
- # Use Git Bash to download and unpack the artifact
593
-
594
- ## Get artifact
595
- urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
596
- id=${{ needs.pkg.outputs.latest-sdk64-extra-build-id }}
597
- download_url=$(curl "$urlbase/$id/artifacts" |
598
- jq -r '.value[] | select(.name == "git-sdk-64-build-installers").resource.downloadUrl')
599
-
600
- curl -o artifacts.zip "$download_url"
601
-
602
- ## Unpack artifact
603
- unzip artifacts.zip
483
+ flavor : build-installers
604
484
- name : Clone and update build-extra
605
485
if : env.SKIP != 'true'
606
486
shell : bash
607
487
run : |
608
- d=git-sdk-64-build-installers /usr/src/build-extra &&
488
+ d=/usr/src/build-extra &&
609
489
if test ! -d $d/.git
610
490
then
611
491
git clone --single-branch -b main https://github.com/git-for-windows/build-extra $d
@@ -618,13 +498,11 @@ jobs:
618
498
if : env.SKIP != 'true'
619
499
- name : Build 64-bit NuGet packages
620
500
if : env.SKIP != 'true'
621
- shell : powershell
501
+ shell : bash
622
502
run : |
623
- & .\git-sdk-64-build-installers\usr\bin\bash.exe -lc @"
624
- /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --version=`$(cat pkg-x86_64/ver) -o artifacts --nuget --pkg=pkg-x86_64/mingw-w64-x86_64-git-[0-9]*.tar.xz --pkg=pkg-x86_64/mingw-w64-x86_64-git-doc-html-[0-9]*.tar.xz &&
625
- /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --version=`$(cat pkg-x86_64/ver) -o artifacts --nuget-mingit &&
626
- openssl dgst -sha256 artifacts/Git*.nupkg | sed \"s/.* //\" >artifacts/sha-256.txt
627
- "@
503
+ /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --version=$(cat pkg-x86_64/ver) -o artifacts --nuget --pkg=pkg-x86_64/mingw-w64-x86_64-git-[0-9]*.tar.xz --pkg=pkg-x86_64/mingw-w64-x86_64-git-doc-html-[0-9]*.tar.xz &&
504
+ /usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --version=$(cat pkg-x86_64/ver) -o artifacts --nuget-mingit &&
505
+ openssl dgst -sha256 artifacts/Git*.nupkg | sed "s/.* //" >artifacts/sha-256.txt
628
506
- name : Publish nuget-x86_64
629
507
if : env.SKIP != 'true'
630
508
uses : actions/upload-artifact@v1
0 commit comments