Skip to content

Commit

Permalink
Merge pull request #515 from dennisameling/git-arm64-support
Browse files Browse the repository at this point in the history
Add arm64 support for Git for Windows and update to 2.47.1
  • Loading branch information
sergiou87 authored Jan 21, 2025
2 parents ef57d76 + dfbfaac commit db3ebfe
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 37 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,17 @@ jobs:
fail-fast: false
matrix:
os: [macos-13, windows-2019, ubuntu-20.04]
arch: [x86, x64]
arch: [x86, x64, arm64]
include:
- os: macos-13
friendlyName: macOS
targetPlatform: macOS
- os: macos-13
friendlyName: macOS
targetPlatform: macOS
arch: arm64
- os: windows-2019
friendlyName: Windows
targetPlatform: win32
- os: ubuntu-20.04
friendlyName: Linux
targetPlatform: ubuntu
- os: ubuntu-20.04
friendlyName: Linux
targetPlatform: ubuntu
arch: arm64
- os: ubuntu-20.04
friendlyName: Linux
targetPlatform: ubuntu
Expand Down Expand Up @@ -118,15 +110,7 @@ jobs:
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf libcurl4-gnutls-dev:armhf zlib1g-dev:armhf libssl-dev:armhf gettext
- name: Build (except macOS arm64)
if: matrix.targetPlatform != 'macOS' || matrix.arch != 'arm64'
shell: bash
run: script/build.sh
env:
TARGET_PLATFORM: ${{ matrix.targetPlatform }}
TARGET_ARCH: ${{ matrix.arch }}
- name: Build (macOS arm64)
if: matrix.targetPlatform == 'macOS' && matrix.arch == 'arm64'
- name: Build
shell: bash
run: script/build.sh
env:
Expand Down
27 changes: 20 additions & 7 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{
"git": {
"version": "v2.45.3",
"version": "v2.47.1",
"packages": [
{
"platform": "windows",
"arch": "amd64",
"filename": "MinGit-2.45.2.2-64-bit.zip",
"url": "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.2/MinGit-2.45.2.2-64-bit.zip",
"checksum": "93ce6daa762cd82b7558162b7caee6fc60dc6e630b0b4b1a15307e7480a0c64d"
"filename": "MinGit-2.47.1.2-64-bit.zip",
"url": "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/MinGit-2.47.1.2-64-bit.zip",
"checksum": "5bafb35dfb249b89d726b37824eeb5022379f0e51f5fbf9c29f49bef57e85b42"
},
{
"platform": "windows",
"arch": "x86",
"filename": "MinGit-2.45.2.2-32-bit.zip",
"url": "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.2/MinGit-2.45.2.2-32-bit.zip",
"checksum": "f1b3272a303435c89e60645e2f1460b9c6679032f6ff15b21713b7d44044dd3e"
"filename": "MinGit-2.47.1.2-32-bit.zip",
"url": "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/MinGit-2.47.1.2-32-bit.zip",
"checksum": "adae5363e224be913af65b3b8c454463e220dd12c811bf5f298952ba4106589a"
},
{
"platform": "windows",
"arch": "arm64",
"filename": "MinGit-2.47.1.2-arm64.zip",
"url": "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/MinGit-2.47.1.2-arm64.zip",
"checksum": "c74dd8e25b2337bbef059440966ba7bf96da4b4a8bc9bf9c759a2bc5a868da2b"
}
]
},
Expand Down Expand Up @@ -57,6 +64,12 @@
"name": "git-lfs-windows-amd64-v3.6.1.zip",
"checksum": "aaca788e04f91676e58654d5ecf96cf03c76768a63b3a6918281a9678884c20c"
},
{
"platform": "windows",
"arch": "arm64",
"name": "git-lfs-windows-arm64-v3.6.1.zip",
"checksum": "ad40ab00a73ef4bf63c969472d0e5a824686b495dbc01ea8e9e4cc456c49a4b0"
},
{
"platform": "darwin",
"arch": "amd64",
Expand Down
2 changes: 1 addition & 1 deletion git
Submodule git updated 1346 files
25 changes: 18 additions & 7 deletions script/build-win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ if [[ -z "${DESTINATION}" ]]; then
exit 1
fi

if [ "$TARGET_ARCH" = "x64" ]; then
DEPENDENCY_ARCH="amd64"
MINGW_DIR="mingw64"
else
DEPENDENCY_ARCH="x86"
MINGW_DIR="mingw32"
fi
case $TARGET_ARCH in
x64)
DEPENDENCY_ARCH="amd64"
MINGW_DIR="mingw64"
;;
x86)
DEPENDENCY_ARCH="x86"
MINGW_DIR="mingw32"
;;
arm64)
DEPENDENCY_ARCH="arm64"
MINGW_DIR="clangarm64"
;;
*)
echo "Unsupported architecture: $TARGET_ARCH"
exit 1
;;
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)"
Expand Down
1 change: 1 addition & 0 deletions script/update-git-lfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async function run(): Promise<boolean> {
`git-lfs-linux-arm-${version}.tar.gz`,
`git-lfs-windows-386-${version}.zip`,
`git-lfs-windows-amd64-${version}.zip`,
`git-lfs-windows-arm64-${version}.zip`,
`git-lfs-darwin-amd64-${version}.zip`,
`git-lfs-darwin-arm64-${version}.zip`,
]
Expand Down
17 changes: 13 additions & 4 deletions script/update-git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ async function getLatestStableRelease() {
async function getPackageDetails(
assets: ReleaseAssets,
body: string,
arch: string
arch: 'amd64' | 'x86' | 'arm64'
) {
const archValue = arch === 'amd64' ? '64-bit' : '32-bit'
const archValue = {
amd64: '64-bit',
x86: '32-bit',
arm64: 'arm64',
}[arch]

const minGitFile = assets.find(
a => a.name.indexOf('MinGit') !== -1 && a.name.indexOf(archValue) !== -1
Expand Down Expand Up @@ -181,12 +185,17 @@ async function run() {

const package64bit = await getPackageDetails(assets, body, 'amd64')
const package32bit = await getPackageDetails(assets, body, 'x86')
const packagearm64 = await getPackageDetails(assets, body, 'arm64')

if (package64bit == null || package32bit == null) {
if (package64bit == null || package32bit == null || packagearm64 == null) {
return
}

updateGitDependencies(latestGitVersion, [package64bit, package32bit])
updateGitDependencies(latestGitVersion, [
package64bit,
package32bit,
packagearm64,
])

console.log(
`✅ Updated dependencies metadata to Git ${latestGitVersion} (Git for Windows ${version})`
Expand Down

0 comments on commit db3ebfe

Please sign in to comment.