Skip to content

Commit

Permalink
First work for arm64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisameling committed Mar 8, 2021
1 parent f9ceb12 commit 64aae86
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
- os: windows-2019
friendlyName: Windows
targetPlatform: win32
- os: windows-2019
friendlyName: Windows
targetPlatform: win32
arch: arm64
- os: ubuntu-18.04
friendlyName: Linux
targetPlatform: ubuntu
Expand Down
9 changes: 8 additions & 1 deletion dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
"filename": "MinGit-2.29.2.3-32-bit.zip",
"url": "https://github.com/git-for-windows/git/releases/download/v2.29.2.windows.3/MinGit-2.29.2.3-32-bit.zip",
"checksum": "e2b7302b2cb013a27984ba65aeff11030b32b7e19deb228304e3e5b85b31befd"
},
{
"platform": "windows",
"arch": "arm64",
"filename": "MinGit-2.30.0-arm64.zip",
"url": "https://github.com/dennisameling/git/releases/download/2.30.0-beta2/MinGit-2.30.0-arm64.zip",
"checksum": "d105fadcc2d407952c777577aa4c263e3878816e52230e5824169cffa0d9bdc6"
}
]
},
Expand All @@ -29,7 +36,7 @@
},
{
"platform": "windows",
"arch": "x86",
"arch": "386",
"name": "git-lfs-windows-386-v2.13.2.zip",
"checksum": "27d061f9fd6b14555c220758ae0b77d81ef20f64dde0179a515d55a75f5355a8"
},
Expand Down
37 changes: 23 additions & 14 deletions script/build-win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,31 @@ if [[ -z "${DESTINATION}" ]]; then
exit 1
fi

if [ "$TARGET_ARCH" = "64" ]; then
DEPENDENCY_ARCH="amd64"
MINGW_DIR="mingw64"
else
DEPENDENCY_ARCH="x86"
MINGW_DIR="mingw32"
fi
case $TARGET_ARCH in
64)
GIT_ARCH="amd64"
MINGW_DIR="mingw64"
GIT_LFS_ARCH="amd64"
;;
32)
GIT_ARCH="x86"
MINGW_DIR="mingw32"
GIT_LFS_ARCH="386"
;;
arm64)
GIT_ARCH="arm64"
MINGW_DIR="arm64"
GIT_LFS_ARCH="386"
;;
*)
die "Unsupported architecture: $TARGET_ARCH"
;;
esac

GIT_LFS_VERSION=$(jq --raw-output ".[\"git-lfs\"].version[1:]" dependencies.json)
GIT_LFS_CHECKSUM="$(jq --raw-output ".\"git-lfs\".files[] | select(.arch == \"$DEPENDENCY_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json)"
GIT_FOR_WINDOWS_URL=$(jq --raw-output ".git.packages[] | select(.arch == \"$DEPENDENCY_ARCH\" and .platform == \"windows\") | .url" dependencies.json)
GIT_FOR_WINDOWS_CHECKSUM=$(jq --raw-output ".git.packages[] | select(.arch == \"$DEPENDENCY_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json)
GIT_LFS_CHECKSUM="$(jq --raw-output ".\"git-lfs\".files[] | select(.arch == \"$GIT_LFS_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json)"
GIT_FOR_WINDOWS_URL=$(jq --raw-output ".git.packages[] | select(.arch == \"$GIT_ARCH\" and .platform == \"windows\") | .url" dependencies.json)
GIT_FOR_WINDOWS_CHECKSUM=$(jq --raw-output ".git.packages[] | select(.arch == \"$GIT_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json)

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=script/compute-checksum.sh
Expand All @@ -47,7 +60,6 @@ if [[ "$GIT_LFS_VERSION" ]]; then
# download Git LFS, verify its the right contents, and unpack it
echo "-- Bundling Git LFS"
GIT_LFS_FILE=git-lfs.zip
if [ "$TARGET_ARCH" -eq "64" ]; then GIT_LFS_ARCH="amd64"; else GIT_LFS_ARCH="386"; fi
GIT_LFS_URL="https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-windows-${GIT_LFS_ARCH}-v${GIT_LFS_VERSION}.zip"
echo "-- Downloading from $GIT_LFS_URL"
curl -sL -o $GIT_LFS_FILE "$GIT_LFS_URL"
Expand Down Expand Up @@ -139,7 +151,4 @@ elif [[ -f "$DESTINATION/$MINGW_DIR/etc/gitattributes" ]]; then
rm "$DESTINATION/$MINGW_DIR/etc/gitattributes"
fi

echo "-- Removing legacy credential helpers"
rm "$DESTINATION/$MINGW_DIR/bin/git-credential-wincred.exe"

set +eu
16 changes: 15 additions & 1 deletion script/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,28 @@ if ! [ -d "$DESTINATION" ]; then
exit 1
fi

case $TARGET_ARCH in
64)
ARCH=x64
;;
32)
ARCH=x86
;;
arm64)
ARCH=arm64
;;
*)
die "Unsupported architecture: $TARGET_ARCH"
;;
esac

if [ "$TARGET_PLATFORM" == "ubuntu" ]; then
GZIP_FILE="dugite-native-$VERSION-$BUILD_HASH-ubuntu.tar.gz"
LZMA_FILE="dugite-native-$VERSION-$BUILD_HASH-ubuntu.lzma"
elif [ "$TARGET_PLATFORM" == "macOS" ]; then
GZIP_FILE="dugite-native-$VERSION-$BUILD_HASH-macOS.tar.gz"
LZMA_FILE="dugite-native-$VERSION-$BUILD_HASH-macOS.lzma"
elif [ "$TARGET_PLATFORM" == "win32" ]; then
if [ "$TARGET_ARCH" -eq "64" ]; then ARCH="x64"; else ARCH="x86"; fi
GZIP_FILE="dugite-native-$VERSION-$BUILD_HASH-windows-$ARCH.tar.gz"
LZMA_FILE="dugite-native-$VERSION-$BUILD_HASH-windows-$ARCH.lzma"
else
Expand Down

0 comments on commit 64aae86

Please sign in to comment.