diff --git a/.github/macos-installer/Makefile b/.github/macos-installer/Makefile index fa7cfe9eb77e4a..ff59f2139914f5 100644 --- a/.github/macos-installer/Makefile +++ b/.github/macos-installer/Makefile @@ -9,21 +9,12 @@ TARGET_FLAGS := -mmacosx-version-min=$(OSX_VERSION) -DMACOSX_DEPLOYMENT_TARGET=$ uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') -ifeq ($(uname_M),x86_64) - ARCH := x86_64 - ARCH_CODE := x86_64 - ARCH_FLAGS_x86_64 := -arch x86_64 - CPU_VENDOR := Intel -endif -ifeq ($(uname_M),arm64) - ARCH := arm64 - ARCH_CODE := arm64 - ARCH_FLAGS_arm64 := -arch arm64 - CPU_VENDOR := Apple Silicon -endif - -CFLAGS := $(TARGET_FLAGS) $(ARCH_FLAGS_${ARCH_CODE}) -LDFLAGS := $(TARGET_FLAGS) $(ARCH_FLAGS_${ARCH_CODE}) +ARCH := universal +ARCH_CODE := universal +ARCH_FLAGS := -arch x86_64 -arch arm64 + +CFLAGS := $(TARGET_FLAGS) $(ARCH_FLAGS) +LDFLAGS := $(TARGET_FLAGS) $(ARCH_FLAGS) PREFIX := /usr/local GIT_PREFIX := $(PREFIX)/git @@ -98,13 +89,8 @@ $(BUILD_DIR)/git-$(VERSION)/osx-installed: $(DESTDIR)$(GIT_PREFIX)/VERSION-$(VER touch $@ $(BUILD_DIR)/git-$(VERSION)/osx-built-assert-$(ARCH_CODE): $(BUILD_DIR)/git-$(VERSION)/osx-built -ifeq ("$(ARCH_CODE)", "universal") File $(BUILD_DIR)/git-$(VERSION)/git File $(BUILD_DIR)/git-$(VERSION)/contrib/credential/osxkeychain/git-credential-osxkeychain -else - [ "$$(File $(BUILD_DIR)/git-$(VERSION)/git | cut -f 5 -d' ')" == "$(ARCH_CODE)" ] - [ "$$(File $(BUILD_DIR)/git-$(VERSION)/contrib/credential/osxkeychain/git-credential-osxkeychain | cut -f 5 -d' ')" == "$(ARCH_CODE)" ] -endif touch $@ disk-image/VERSION-$(VERSION)-$(ARCH_CODE): @@ -116,7 +102,7 @@ disk-image/git-$(VERSION)-$(BUILD_CODE).pkg: disk-image/VERSION-$(VERSION)-$(ARC pkgbuild --identifier com.git.pkg --version $(VERSION) --root $(ARTIFACTDIR)$(PREFIX) --scripts assets/scripts --install-location $(PREFIX) --component-plist ./assets/git-components.plist disk-image/git-$(VERSION)-$(BUILD_CODE).pkg git-%-$(BUILD_CODE).dmg: - hdiutil create git-$(VERSION)-$(BUILD_CODE).uncompressed.dmg -fs HFS+ -srcfolder disk-image -volname "Git $(VERSION) $(CPU_VENDOR) $(ARCH)" -ov + hdiutil create git-$(VERSION)-$(BUILD_CODE).uncompressed.dmg -fs HFS+ -srcfolder disk-image -volname "Git $(VERSION) $(ARCH)" -ov hdiutil convert -format UDZO -o $@ git-$(VERSION)-$(BUILD_CODE).uncompressed.dmg rm -f git-$(VERSION)-$(BUILD_CODE).uncompressed.dmg diff --git a/.github/workflows/build-git-installers.yml b/.github/workflows/build-git-installers.yml index 56f5fa01e32d5e..d4cdb0891db9a2 100644 --- a/.github/workflows/build-git-installers.yml +++ b/.github/workflows/build-git-installers.yml @@ -313,8 +313,6 @@ jobs: strategy: matrix: arch: - - name: x86_64 - runner: macos-latest - name: arm64 runner: macos-latest-xl-arm64 runs-on: ${{ matrix.arch.runner }} @@ -347,10 +345,6 @@ jobs: # Write to "version" file to force match with trigger payload version echo "${{ needs.prereqs.outputs.tag_version }}" >>git/version - # On Apple Silicon, homebrew apparently does not install a `gcc` symlink - test x86_64 = '${{ matrix.arch.name }}' || - echo 'CC = gcc-13' >>config.mak - # To make use of the catalogs... homebrew_prefix="$(brew --prefix)" export XML_CATALOG_FILES=$homebrew_prefix/etc/xml/catalog @@ -372,7 +366,7 @@ jobs: # environment variable or the tag_version output from the prereqs # job in the upload-artifact task. mkdir -p build_artifacts - cp -R stage/git-${{ matrix.arch.name }}-$VERSION/ build_artifacts + cp -R stage/git-universal-$VERSION/ build_artifacts # We keep a list of executable files because their executable bits are # removed when they are zipped, and we need to re-add. @@ -381,7 +375,7 @@ jobs: - name: Upload macOS artifacts uses: actions/upload-artifact@v3 with: - name: tmp.osx-${{ matrix.arch.name }}-build + name: tmp.osx-universal-build path: | build_artifacts @@ -399,7 +393,7 @@ jobs: needs: osx_build strategy: matrix: - arch: [x86_64, arm64] + arch: [arm64] steps: - name: Check out repository uses: actions/checkout@v3 @@ -409,7 +403,7 @@ jobs: - name: Download unsigned build artifacts uses: actions/download-artifact@v3 with: - name: tmp.osx-${{ matrix.arch }}-build + name: tmp.osx-universal-build path: build_artifacts - name: Zip unsigned build artifacts @@ -452,7 +446,7 @@ jobs: - name: Upload signed payload uses: actions/upload-artifact@v3 with: - name: osx-signed-${{ matrix.arch }}-payload + name: osx-signed-universal-payload path: | signed @@ -460,8 +454,6 @@ jobs: strategy: matrix: arch: - - name: x86_64 - runner: macos-latest - name: arm64 runner: macos-latest-xl-arm64 runs-on: ${{ matrix.arch.runner }} @@ -475,7 +467,7 @@ jobs: - name: Download signed artifacts uses: actions/download-artifact@v3 with: - name: osx-signed-${{ matrix.arch.name }}-payload + name: osx-signed-universal-payload - name: Download list of executable files uses: actions/download-artifact@v3 @@ -513,14 +505,14 @@ jobs: - name: Upload unsigned pkg uses: actions/upload-artifact@v3 with: - name: tmp.osx-${{ matrix.arch.name }}-pkg + name: tmp.osx-universal-pkg path: | git/.github/macos-installer/disk-image osx_sign_and_notarize_pkg: strategy: matrix: - arch: [x86_64, arm64] + arch: [arm64] # ESRP service requires signing to run on Windows runs-on: windows-latest environment: release @@ -534,7 +526,7 @@ jobs: - name: Download unsigned package uses: actions/download-artifact@v3 with: - name: tmp.osx-${{ matrix.arch }}-pkg + name: tmp.osx-universal-pkg path: pkg - name: Zip unsigned package @@ -586,7 +578,7 @@ jobs: - name: Upload signed and notarized pkg uses: actions/upload-artifact@v3 with: - name: osx-signed-${{ matrix.arch }}-pkg + name: osx-signed-universal-pkg path: | signed @@ -594,8 +586,6 @@ jobs: strategy: matrix: arch: - - name: x86_64 - runner: macos-latest - name: arm64 runner: macos-latest-xl-arm64 runs-on: ${{ matrix.arch.runner }} @@ -609,7 +599,7 @@ jobs: - name: Download signed package uses: actions/download-artifact@v3 with: - name: osx-signed-${{ matrix.arch.name }}-pkg + name: osx-signed-universal-pkg path: disk-image - name: Build macOS disk image @@ -632,7 +622,7 @@ jobs: - name: Publish disk image uses: actions/upload-artifact@v3 with: - name: osx-${{ matrix.arch.name }}-dmg + name: osx-universal-dmg path: git/.github/macos-installer/*.dmg # End build and sign Mac OSX installers @@ -765,10 +755,7 @@ jobs: artifact: deb-package-signed command: git - os: macos-latest-xl-arm64 - artifact: osx-signed-arm64-pkg - command: git - - os: macos-latest - artifact: osx-signed-x86_64-pkg + artifact: osx-signed-universal-pkg command: git - os: windows-latest artifact: win-installer-x86_64 @@ -831,25 +818,15 @@ jobs: with: name: win-installer-x86_64 path: win-installer-x86_64 - - name: Download Mac x86_64 dmg - uses: actions/download-artifact@v3 - with: - name: osx-x86_64-dmg - path: osx-dmg - - name: Download Mac ARM64 dmg + - name: Download Mac universal dmg uses: actions/download-artifact@v3 with: - name: osx-arm64-dmg + name: osx-universal-dmg path: osx-dmg - - name: Download Mac x86_64 pkg - uses: actions/download-artifact@v3 - with: - name: osx-signed-x86_64-pkg - path: osx-pkg - - name: Download Mac ARM64 pkg + - name: Download Mac universal pkg uses: actions/download-artifact@v3 with: - name: osx-signed-arm64-pkg + name: osx-signed-universal-pkg path: osx-pkg - name: Download Ubuntu package (signed) if: needs.prereqs.outputs.deb_signable == 'true'