Skip to content

Commit 6bb1f51

Browse files
committed
git-artifacts: add ARM64 artifacts
Adds ARM64 artifacts to the git-artifacts GitHub Action workflow. Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
1 parent a06cc14 commit 6bb1f51

File tree

1 file changed

+122
-3
lines changed

1 file changed

+122
-3
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 122 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,84 @@ jobs:
253253
with:
254254
name: pkg-${{matrix.arch.name}}
255255
path: artifacts
256+
build-arm64:
257+
needs: bundle-artifacts
258+
env:
259+
MSYSTEM: MINGW64
260+
NO_PERL: 1
261+
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
262+
runs-on: windows-latest
263+
steps:
264+
- uses: actions/checkout@v1
265+
- name: Determine latest git-sdk-64-minimal build ID
266+
id: determine-latest-git-sdk-64-minimal-build-id
267+
shell: bash
268+
run: |
269+
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
270+
id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
271+
jq -r '.value[0].id')
272+
273+
echo "Latest ID is ${id}"
274+
echo "::set-output name=id::$id"
275+
- name: Cache git-sdk-64-minimal
276+
id: cache-git-sdk-64-minimal
277+
uses: actions/cache@v2
278+
with:
279+
path: git-sdk-64-minimal
280+
key: sdk-64-minimal-${{ steps.determine-latest-git-sdk-64-minimal-build-id.outputs.id }}
281+
- name: download git-sdk-64-minimal
282+
if: steps.cache-git-sdk-64-minimal.outputs.cache-hit != 'true'
283+
shell: bash
284+
run: |
285+
## Get artifact
286+
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
287+
id=${{ steps.determine-latest-git-sdk-64-minimal-build-id.outputs.id }}
288+
download_url="$(curl "$urlbase/$id/artifacts" |
289+
jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
290+
curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
291+
-o artifacts.zip "$download_url"
292+
## Unzip and remove the artifact
293+
unzip artifacts.zip
294+
rm artifacts.zip
295+
- name: initialize vcpkg
296+
uses: actions/checkout@v2
297+
with:
298+
repository: 'microsoft/vcpkg'
299+
path: 'compat/vcbuild/vcpkg'
300+
- name: download vcpkg artifacts
301+
shell: powershell
302+
run: |
303+
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
304+
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
305+
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
306+
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
307+
Expand-Archive compat.zip -DestinationPath . -Force
308+
Remove-Item compat.zip
309+
- name: add msbuild to PATH
310+
uses: microsoft/setup-msbuild@v1
311+
- name: copy dlls to root
312+
shell: powershell
313+
run: |
314+
& compat\vcbuild\vcpkg_copy_dlls.bat release arm64-windows
315+
if (!$?) { exit(1) }
316+
- name: generate Visual Studio solution
317+
shell: bash
318+
run: |
319+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/arm64-windows \
320+
-DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=arm64 -DVCPKG_ARCH=arm64-windows \
321+
-DCMAKE_INSTALL_PREFIX="`pwd`/git-arm64"
322+
- name: MSBuild
323+
run: msbuild git.sln -property:Configuration=Release
324+
- name: Link the Git executables
325+
run: msbuild INSTALL.vcxproj -property:Configuration=Release
326+
- name: upload build artifacts
327+
uses: actions/upload-artifact@v1
328+
with:
329+
name: arm64-artifacts
330+
path: ./git-arm64
256331
artifacts:
257332
runs-on: windows-latest
258-
needs: pkg
333+
needs: [pkg, build-arm64]
259334
strategy:
260335
matrix:
261336
artifact:
@@ -277,6 +352,15 @@ jobs:
277352
bitness: 64
278353
- name: i686
279354
bitness: 32
355+
- name: arm64
356+
bitness: 32
357+
exclude:
358+
# Needs https://github.com/git-for-windows/build-extra/pull/326
359+
- artifact:
360+
name: installer
361+
arch:
362+
name: arm64
363+
bitness: 32
280364
fail-fast: false
281365
env:
282366
MSYSTEM: MINGW${{matrix.arch.bitness}}
@@ -289,12 +373,27 @@ jobs:
289373
*" ${{matrix.artifact.name}} "*|*" ${{matrix.artifact.name}}-${{matrix.arch.name}} "*) ;; # build this artifact
290374
*) echo "SKIP=true" >>$GITHUB_ENV;;
291375
esac
376+
- name: Configure user
377+
shell: bash
378+
run:
379+
USER_NAME="${{github.actor}}" &&
380+
USER_EMAIL="${{github.actor}}@users.noreply.github.com" &&
381+
mkdir -p "$HOME" &&
382+
git config --global user.name "$USER_NAME" &&
383+
git config --global user.email "$USER_EMAIL" &&
384+
echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV
292385
- name: Download pkg-${{matrix.arch.name}}
293-
if: env.SKIP != 'true'
386+
if: env.SKIP != 'true' && matrix.arch.name != 'arm64'
294387
uses: actions/download-artifact@v1
295388
with:
296389
name: pkg-${{matrix.arch.name}}
297390
path: pkg-${{matrix.arch.name}}
391+
- name: Download pkg-i686
392+
if: env.SKIP != 'true' && matrix.arch.name == 'arm64'
393+
uses: actions/download-artifact@v1
394+
with:
395+
name: pkg-i686
396+
path: pkg-i686
298397
- name: Download bundle-artifacts
299398
if: env.SKIP != 'true'
300399
uses: actions/download-artifact@v1
@@ -324,6 +423,12 @@ jobs:
324423
325424
## Unpack artifact
326425
unzip artifacts.zip
426+
- name: Download arm64 artifact
427+
if: matrix.arch.name == 'arm64'
428+
uses: actions/download-artifact@v1
429+
with:
430+
name: arm64-artifacts
431+
path: ${{github.workspace}}/arm64
327432
- name: Determine latest git-sdk-32-extra-artifacts build ID
328433
if: env.SKIP != 'true' && matrix.arch.bitness == '32'
329434
id: determine-latest-sdk32-extra-build-id
@@ -383,7 +488,7 @@ jobs:
383488
echo -n "$CODESIGN_PASS" >home/.sig/codesign.pass &&
384489
git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"'
385490
- name: Build ${{matrix.arch.bitness}}-bit ${{matrix.artifact.name}}
386-
if: env.SKIP != 'true'
491+
if: env.SKIP != 'true' && matrix.arch.name != 'arm64'
387492
shell: powershell
388493
run: |
389494
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
@@ -395,6 +500,20 @@ jobs:
395500
fi &&
396501
openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed \"s/.* //\" >artifacts/sha-256.txt
397502
"@
503+
# The ARM64 build uses the i686 package with some added ARM64 artifacts
504+
- name: Build ARM64 ${{matrix.artifact.name}}
505+
if: env.SKIP != 'true' && matrix.arch.name == 'arm64'
506+
shell: powershell
507+
run: |
508+
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
509+
set -x
510+
/usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --include-arm64-artifacts=\"`$PWD/arm64\" --version=`$(cat pkg-i686/ver) -o artifacts --${{matrix.artifact.name}} --pkg=pkg-i686/mingw-w64-i686-git-[0-9]*.tar.xz --pkg=pkg-i686/mingw-w64-i686-git-doc-html-[0-9]*.tar.xz &&
511+
if test portable = '${{matrix.artifact.name}}' && test -n \"`$(git config alias.signtool)\"
512+
then
513+
git signtool artifacts/PortableGit-*.exe
514+
fi &&
515+
openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed \"s/.* //\" >artifacts/sha-256.txt
516+
"@
398517
- name: Copy package-versions and pdbs
399518
if: env.SKIP != 'true' && matrix.artifact.name == 'installer'
400519
shell: powershell

0 commit comments

Comments
 (0)