@@ -306,8 +306,6 @@ jobs:
306
306
strategy :
307
307
matrix :
308
308
arch :
309
- - name : x86_64
310
- runner : macos-latest
311
309
- name : arm64
312
310
runner : macos-latest-xl-arm64
313
311
runs-on : ${{ matrix.arch.runner }}
@@ -323,10 +321,20 @@ jobs:
323
321
324
322
- name : Install Git dependencies
325
323
run : |
326
- set -x
324
+ set -ex
325
+
326
+ # Install x86_64 packages
327
+ arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
328
+ arch -x86_64 /usr/local/bin/brew install gettext curl
329
+
330
+ # Install arm64 packages
327
331
brew install automake asciidoc xmlto docbook
328
332
brew link --force gettext
329
333
334
+ # Make universal gettext and curl library
335
+ lipo -create -output libintl.a /usr/local/opt/gettext/lib/libintl.a /opt/homebrew/opt/gettext/lib/libintl.a
336
+ lipo -create -output libcurl.dylib /opt/homebrew/opt/curl/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib
337
+
330
338
- name : Set up signing/notarization infrastructure
331
339
env :
332
340
A1 : ${{ secrets.APPLICATION_CERTIFICATE_BASE64 }}
@@ -383,24 +391,37 @@ jobs:
383
391
exit 1
384
392
}
385
393
386
- # Configure the environment
394
+ # Trace execution, stop on error
387
395
set -ex
388
- PATH=/usr/local/bin:$PATH
389
- export CURL_LDFLAGS=$(curl-config --libs)
390
396
391
397
# Write to "version" file to force match with trigger payload version
392
398
echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version
393
399
400
+ # Configure universal build
401
+ cat >git/config.mak <<EOF
402
+ # Create universal binaries. HOST_CPU is a bit of a lie and only
403
+ # used in 'git version --build-options'. We'll fix that in code.
404
+ HOST_CPU = universal
405
+ BASIC_CFLAGS += -arch arm64 -arch x86_64
406
+ EOF
407
+
394
408
# Configure the Git build to pick up gettext
395
409
homebrew_prefix="$(brew --prefix)"
396
- cat >git/config.mak <<EOF
397
- LDFLAGS = -L$homebrew_prefix/lib -L/usr/local/opt/gettext/lib
410
+ cat >>git/config.mak <<EOF
398
411
CFLAGS = -I$homebrew_prefix/include -I/usr/local/opt/gettext/include
412
+ LDFLAGS = -L"$(pwd)"
399
413
EOF
400
414
401
- # On Apple Silicon, homebrew apparently does not install a `gcc` symlink
402
- test x86_64 = '${{ matrix.arch.name }}' ||
403
- echo 'CC = gcc-13' >>config.mak
415
+ # Configure the Git build to pick up the universal `libcurl.dylib`
416
+ cat >>git/config.mak <<EOF
417
+ CURL_LDFLAGS := -L"$(pwd)" -lcurl
418
+ CURL_CONFIG := /usr/bin/true
419
+ EOF
420
+
421
+ # Avoid even building the dashed built-ins; Those should be hard-linked
422
+ # copies of the `git` executable but would end up as actual copies instead,
423
+ # bloating the size of the `.dmg` indecently.
424
+ echo 'SKIP_DASHED_BUILT_INS = YabbaDabbaDoo' >>git/config.mak
404
425
405
426
# To make use of the catalogs...
406
427
export XML_CATALOG_FILES=$homebrew_prefix/etc/xml/catalog
@@ -416,10 +437,11 @@ jobs:
416
437
tar -xvf git/git-manpages-$VERSION.tar.gz -C manpages
417
438
418
439
# Lay out payload
440
+ cp git/config.mak payload/git-$VERSION/config.mak
419
441
make -C git/.github/macos-installer V=1 payload
420
442
421
443
# Codesign payload
422
- cp -R stage/git-${{ matrix.arch.name }} -$VERSION/ \
444
+ cp -R stage/git-universal -$VERSION/ \
423
445
git/.github/macos-installer/build-artifacts
424
446
make -C git/.github/macos-installer V=1 codesign \
425
447
APPLE_APP_IDENTITY="$A3" || die "Creating signed payload failed"
@@ -584,6 +606,9 @@ jobs:
584
606
- os : macos-latest
585
607
artifact : macos-artifacts
586
608
command : git
609
+ - os : macos-latest-xl-arm64
610
+ artifact : macos-artifacts
611
+ command : git
587
612
- os : windows-latest
588
613
artifact : win-installer-x86_64
589
614
command : $PROGRAMFILES\Git\cmd\git.exe
@@ -616,7 +641,7 @@ jobs:
616
641
test arm64 != "$arch" ||
617
642
brew uninstall git
618
643
619
- pkgpath=$(find ./*$arch *.pkg)
644
+ pkgpath=$(find ./*universal *.pkg)
620
645
sudo installer -pkg $pkgpath -target /
621
646
622
647
- name : Validate
@@ -625,6 +650,15 @@ jobs:
625
650
"${{ matrix.component.command }}" --version | sed 's/git version //' >actual
626
651
echo ${{ needs.prereqs.outputs.tag_version }} >expect
627
652
cmp expect actual || exit 1
653
+
654
+ - name : Validate universal binary CPU architecture
655
+ if : contains(matrix.component.os, 'macos')
656
+ shell : bash
657
+ run : |
658
+ set -ex
659
+ git version --build-options >actual
660
+ cat actual
661
+ grep "cpu: $(uname -m)" actual
628
662
# End validate installers
629
663
630
664
create-github-release :
0 commit comments