Skip to content

Commit 0f8e66c

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 0f8e66c

File tree

1 file changed

+102
-3
lines changed

1 file changed

+102
-3
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,88 @@ jobs:
253253
with:
254254
name: pkg-${{matrix.arch.name}}
255255
path: artifacts
256+
build-arm64:
257+
needs: bundle-artifacts
258+
runs-on: windows-latest
259+
steps:
260+
- name: Configure user
261+
shell: bash
262+
run:
263+
USER_NAME="${{github.actor}}" &&
264+
USER_EMAIL="${{github.actor}}@users.noreply.github.com" &&
265+
mkdir -p "$HOME" &&
266+
git config --global user.name "$USER_NAME" &&
267+
git config --global user.email "$USER_EMAIL"
268+
- uses: actions/checkout@v1
269+
- name: Determine latest git-sdk-64-minimal build ID
270+
id: determine-latest-git-sdk-64-minimal-build-id
271+
shell: bash
272+
run: |
273+
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
274+
id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
275+
jq -r '.value[0].id')
276+
277+
echo "Latest ID is ${id}"
278+
echo "::set-output name=id::$id"
279+
- name: Cache git-sdk-64-minimal
280+
id: cache-git-sdk-64-minimal
281+
uses: actions/cache@v2
282+
with:
283+
path: git-sdk-64-minimal
284+
key: sdk-64-minimal-${{ steps.determine-latest-git-sdk-64-minimal-build-id.outputs.id }}
285+
- name: download git-sdk-64-minimal
286+
if: steps.cache-git-sdk-64-minimal.outputs.cache-hit != 'true'
287+
shell: bash
288+
run: |
289+
## Get artifact
290+
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
291+
id=${{ steps.determine-latest-git-sdk-64-minimal-build-id.outputs.id }}
292+
download_url="$(curl "$urlbase/$id/artifacts" |
293+
jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
294+
curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
295+
-o artifacts.zip "$download_url"
296+
## Unzip and remove the artifact
297+
unzip artifacts.zip
298+
rm artifacts.zip
299+
- name: initialize vcpkg
300+
uses: actions/checkout@v2
301+
with:
302+
repository: 'microsoft/vcpkg'
303+
path: 'compat/vcbuild/vcpkg'
304+
- name: download vcpkg artifacts
305+
shell: powershell
306+
run: |
307+
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
308+
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
309+
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
310+
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
311+
Expand-Archive compat.zip -DestinationPath . -Force
312+
Remove-Item compat.zip
313+
- name: add msbuild to PATH
314+
uses: microsoft/setup-msbuild@v1
315+
- name: copy dlls to root
316+
shell: powershell
317+
run: |
318+
& compat\vcbuild\vcpkg_copy_dlls.bat release arm64-windows
319+
if (!$?) { exit(1) }
320+
- name: generate Visual Studio solution
321+
shell: bash
322+
run: |
323+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/arm64-windows \
324+
-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 \
325+
-DCMAKE_INSTALL_PREFIX="`pwd`/git-arm64"
326+
- name: MSBuild
327+
run: msbuild git.sln -property:Configuration=Release
328+
- name: Link the Git executables
329+
run: msbuild INSTALL.vcxproj -property:Configuration=Release
330+
- name: upload build artifacts
331+
uses: actions/upload-artifact@v1
332+
with:
333+
name: arm64-artifacts
334+
path: ./git-arm64
256335
artifacts:
257336
runs-on: windows-latest
258-
needs: pkg
337+
needs: [pkg, build-arm64]
259338
strategy:
260339
matrix:
261340
artifact:
@@ -275,8 +354,13 @@ jobs:
275354
arch:
276355
- name: x86_64
277356
bitness: 64
357+
arm64: false
358+
- name: i686
359+
bitness: 32
360+
arm64: false
278361
- name: i686
279362
bitness: 32
363+
arm64: true
280364
fail-fast: false
281365
env:
282366
MSYSTEM: MINGW${{matrix.arch.bitness}}
@@ -358,6 +442,12 @@ jobs:
358442
359443
## Unpack artifact
360444
unzip artifacts.zip
445+
- name: Download arm64 artifact
446+
if: matrix.arch.arm64 == true
447+
uses: actions/download-artifact@v1
448+
with:
449+
name: arm64-artifacts
450+
path: ${{github.workspace}}/arm64
361451
- name: Clone and update build-extra
362452
if: env.SKIP != 'true'
363453
shell: bash
@@ -388,7 +478,8 @@ jobs:
388478
run: |
389479
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
390480
set -x
391-
/usr/src/build-extra/please.sh make_installers_from_mingw_w64_git --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 &&
481+
[[ \"${{matrix.arch.arm64}}\" = true ]] && ARM64=\"--include-arm64-artifacts=\"`$PWD/arm64\"\" || ARM64=
482+
/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 &&
392483
if test portable = '${{matrix.artifact.name}}' && test -n \"`$(git config alias.signtool)\"
393484
then
394485
git signtool artifacts/PortableGit-*.exe
@@ -413,12 +504,20 @@ jobs:
413504
if: always() && env.SKIP != 'true'
414505
shell: bash
415506
run: rm -rf home
507+
416508
- name: Publish ${{matrix.artifact.name}}-${{matrix.arch.name}}
417-
if: env.SKIP != 'true'
509+
if: env.SKIP != 'true' && matrix.arch.arm64 != true
418510
uses: actions/upload-artifact@v1
419511
with:
420512
name: ${{matrix.artifact.name}}-${{matrix.arch.name}}
421513
path: artifacts
514+
515+
- name: Publish ${{matrix.artifact.name}}-arm64
516+
if: env.SKIP != 'true' && matrix.arch.arm64 == true
517+
uses: actions/upload-artifact@v1
518+
with:
519+
name: ${{matrix.artifact.name}}-arm64
520+
path: artifacts
422521
nuget:
423522
runs-on: windows-latest
424523
needs: pkg

0 commit comments

Comments
 (0)