Skip to content

Commit

Permalink
git-artifacts: add ARM64 artifacts
Browse files Browse the repository at this point in the history
Adds ARM64 artifacts to the git-artifacts GitHub Action workflow.

Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
  • Loading branch information
dennisameling committed Feb 7, 2021
1 parent a06cc14 commit 98fdd1e
Showing 1 changed file with 95 additions and 3 deletions.
98 changes: 95 additions & 3 deletions .github/workflows/git-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,81 @@ jobs:
with:
name: pkg-${{matrix.arch.name}}
path: artifacts
build-arm64:
needs: bundle-artifacts
runs-on: windows-latest
steps:
- name: Configure user
shell: bash
run:
USER_NAME="${{github.actor}}" &&
USER_EMAIL="${{github.actor}}@users.noreply.github.com" &&
mkdir -p "$HOME" &&
git config --global user.name "$USER_NAME" &&
git config --global user.email "$USER_EMAIL"
- uses: actions/checkout@v1
- name: Cache git-sdk-64-build-installers
id: cache-sdk-build-installers
uses: actions/cache@v2
with:
path: git-sdk-64-build-installers
key: build-installers-64-${{ needs.bundle-artifacts.outputs.latest-sdk64-extra-build-id }}
- name: Download git-sdk-64-build-installers
if: steps.cache-sdk-build-installers.outputs.cache-hit != 'true'
shell: bash
run: |
# Use Git Bash to download and unpack the artifact
## Get artifact
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
id=${{ needs.bundle-artifacts.outputs.latest-sdk64-extra-build-id }}
download_url=$(curl "$urlbase/$id/artifacts" |
jq -r '.value[] | select(.name == "git-sdk-64-build-installers").resource.downloadUrl')
curl -o artifacts.zip "$download_url"
## Unpack artifact
unzip artifacts.zip
rm artifacts.zip
- name: initialize vcpkg
uses: actions/checkout@v2
with:
repository: 'microsoft/vcpkg'
path: 'compat/vcbuild/vcpkg'
- name: download vcpkg artifacts
shell: powershell
run: |
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
Expand-Archive compat.zip -DestinationPath . -Force
Remove-Item compat.zip
- name: add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: copy dlls to root
shell: powershell
run: |
& compat\vcbuild\vcpkg_copy_dlls.bat release arm64-windows
if (!$?) { exit(1) }
- name: generate Visual Studio solution
shell: bash
run: |
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/arm64-windows \
-DMSGFMT_EXE=`pwd`/git-sdk-64-build-installers/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=arm64 -DVCPKG_ARCH=arm64-windows \
-DCMAKE_INSTALL_PREFIX="`pwd`/git-arm64"
- name: MSBuild
run: msbuild git.sln -property:Configuration=Release
- name: Link the Git executables
run: msbuild INSTALL.vcxproj -property:Configuration=Release
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
name: arm64-artifacts
path: ./git-arm64
artifacts:
runs-on: windows-latest
needs: pkg
needs: [pkg, build-arm64]
strategy:
matrix:
artifact:
Expand All @@ -275,8 +347,13 @@ jobs:
arch:
- name: x86_64
bitness: 64
arm64: false
- name: i686
bitness: 32
arm64: false
- name: i686
bitness: 32
arm64: true
fail-fast: false
env:
MSYSTEM: MINGW${{matrix.arch.bitness}}
Expand Down Expand Up @@ -358,6 +435,12 @@ jobs:
## Unpack artifact
unzip artifacts.zip
- name: Download arm64 artifact
if: matrix.arch.arm64 == true
uses: actions/download-artifact@v1
with:
name: arm64-artifacts
path: ${{github.workspace}}/arm64
- name: Clone and update build-extra
if: env.SKIP != 'true'
shell: bash
Expand Down Expand Up @@ -388,7 +471,8 @@ jobs:
run: |
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
set -x
/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 &&
[[ \"${{matrix.arch.arm64}}\" = true ]] && ARM64=\"--include-arm64-artifacts=\"`$PWD/arm64\"\" || ARM64=
/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 &&
if test portable = '${{matrix.artifact.name}}' && test -n \"`$(git config alias.signtool)\"
then
git signtool artifacts/PortableGit-*.exe
Expand All @@ -413,12 +497,20 @@ jobs:
if: always() && env.SKIP != 'true'
shell: bash
run: rm -rf home

- name: Publish ${{matrix.artifact.name}}-${{matrix.arch.name}}
if: env.SKIP != 'true'
if: env.SKIP != 'true' && matrix.arch.arm64 != true
uses: actions/upload-artifact@v1
with:
name: ${{matrix.artifact.name}}-${{matrix.arch.name}}
path: artifacts

- name: Publish ${{matrix.artifact.name}}-arm64
if: env.SKIP != 'true' && matrix.arch.arm64 == true
uses: actions/upload-artifact@v1
with:
name: ${{matrix.artifact.name}}-arm64
path: artifacts
nuget:
runs-on: windows-latest
needs: pkg
Expand Down

0 comments on commit 98fdd1e

Please sign in to comment.