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 4, 2021
1 parent a06cc14 commit 1fffb92
Showing 1 changed file with 114 additions and 3 deletions.
117 changes: 114 additions & 3 deletions .github/workflows/git-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,76 @@ jobs:
with:
name: pkg-${{matrix.arch.name}}
path: artifacts
build-arm64:
needs: bundle-artifacts
env:
MSYSTEM: MINGW64
NO_PERL: 1
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
runs-on: windows-latest
steps:
- 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
- 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-minimal/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 @@ -277,6 +344,15 @@ jobs:
bitness: 64
- name: i686
bitness: 32
- name: arm64
bitness: 32
exclude:
# Needs https://github.com/git-for-windows/build-extra/pull/326
- artifact:
name: installer
arch:
name: arm64
bitness: 32
fail-fast: false
env:
MSYSTEM: MINGW${{matrix.arch.bitness}}
Expand All @@ -289,12 +365,27 @@ jobs:
*" ${{matrix.artifact.name}} "*|*" ${{matrix.artifact.name}}-${{matrix.arch.name}} "*) ;; # build this artifact
*) echo "SKIP=true" >>$GITHUB_ENV;;
esac
- 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" &&
echo "PACKAGER=$USER_NAME <$USER_EMAIL>" >>$GITHUB_ENV
- name: Download pkg-${{matrix.arch.name}}
if: env.SKIP != 'true'
if: env.SKIP != 'true' && matrix.arch.name != 'arm64'
uses: actions/download-artifact@v1
with:
name: pkg-${{matrix.arch.name}}
path: pkg-${{matrix.arch.name}}
- name: Download pkg-i686
if: env.SKIP != 'true' && matrix.arch.name == 'arm64'
uses: actions/download-artifact@v1
with:
name: pkg-i686
path: pkg-i686
- name: Download bundle-artifacts
if: env.SKIP != 'true'
uses: actions/download-artifact@v1
Expand Down Expand Up @@ -324,6 +415,12 @@ jobs:
## Unpack artifact
unzip artifacts.zip
- name: Download arm64 artifact
if: matrix.arch.name == 'arm64'
uses: actions/download-artifact@v1
with:
name: arm64-artifacts
path: ${{github.workspace}}/arm64
- name: Determine latest git-sdk-32-extra-artifacts build ID
if: env.SKIP != 'true' && matrix.arch.bitness == '32'
id: determine-latest-sdk32-extra-build-id
Expand Down Expand Up @@ -383,7 +480,7 @@ jobs:
echo -n "$CODESIGN_PASS" >home/.sig/codesign.pass &&
git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"'
- name: Build ${{matrix.arch.bitness}}-bit ${{matrix.artifact.name}}
if: env.SKIP != 'true'
if: env.SKIP != 'true' && matrix.arch.name != 'arm64'
shell: powershell
run: |
& .\git-sdk-${{matrix.arch.bitness}}-build-installers\usr\bin\bash.exe -lc @"
Expand All @@ -395,6 +492,20 @@ jobs:
fi &&
openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed \"s/.* //\" >artifacts/sha-256.txt
"@
# The ARM64 build uses the i686 package with some added ARM64 artifacts
- name: Build ARM64 ${{matrix.artifact.name}}
if: env.SKIP != 'true' && matrix.arch.name == 'arm64'
shell: powershell
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 --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 &&
if test portable = '${{matrix.artifact.name}}' && test -n \"`$(git config alias.signtool)\"
then
git signtool artifacts/PortableGit-*.exe
fi &&
openssl dgst -sha256 artifacts/${{matrix.artifact.fileprefix}}-*.${{matrix.artifact.fileextension}} | sed \"s/.* //\" >artifacts/sha-256.txt
"@
- name: Copy package-versions and pdbs
if: env.SKIP != 'true' && matrix.artifact.name == 'installer'
shell: powershell
Expand Down

0 comments on commit 1fffb92

Please sign in to comment.