From ad83c7b9bf27c9ce3f91c504250f95eb8bf4d205 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Tue, 4 Jun 2024 16:21:37 +0200 Subject: [PATCH 01/12] split build test --- .github/workflows/release-test-macos.yml | 80 ++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/release-test-macos.yml diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml new file mode 100644 index 0000000000..adb42f37d3 --- /dev/null +++ b/.github/workflows/release-test-macos.yml @@ -0,0 +1,80 @@ +name: Release + +on: + pull_request: + paths: + - .github/workflows/release-test-macos.yml + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_TERM_COLOR: always + +jobs: + macos: + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + include: + - rust-arch: aarch64 + darwin-arch: arm64 + runs-on: macos-14 + + - rust-arch: x86_64 + darwin-arch: x86_64 + runs-on: macos-13 + env: + RELEASE_TAG_NAME: ${{ needs.tagname.outputs.tag_name }} + + NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }} + NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }} + + APP_NAME: Lapce-macos-${{ matrix.rust-arch }}.app + DMG_NAME: lapce-macos-${{ matrix.rust-arch }}.dmg + + CARGO_BUILD_TARGET: ${{ matrix.rust-arch }}-apple-darwin + steps: + - uses: actions/checkout@v4 + + - name: Update rust + run: rustup update + + - name: Import Certificate + uses: Apple-Actions/import-codesign-certs@v3 + with: + p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} + p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }} + + - name: Fetch dependencies + run: cargo fetch --locked + + - name: Make DMG + run: make dmg + + - name: Rename + run: | + cp ./target/release-lto/macos/Lapce.dmg ./target/release-lto/macos/${{ env.DMG_NAME }} + + - name: Notarize Release Build + uses: lando/notarize-action@v2 + with: + product-path: "./target/release-lto/macos/${{ env.DMG_NAME }}" + appstore-connect-username: ${{ secrets.NOTARIZE_USERNAME }} + appstore-connect-password: ${{ secrets.NOTARIZE_PASSWORD }} + appstore-connect-team-id: CYSGAZFR8D + primary-bundle-id: "io.lapce" + + - name: "Staple Release Build" + uses: lapce/xcode-staple@062485d6eeafe841c18a412f012e80f49e23c517 + with: + product-path: "./target/release-lto/macos/${{ env.DMG_NAME }}" + + - uses: actions/upload-artifact@v4 + with: + name: lapce-macos-${{ matrix.rust-arch }} + path: | + ./target/release-lto/macos/${{ env.DMG_NAME }}.dmg + retention-days: 1 From ab857e2d8df9d990bebb83b0cc1174105da591f8 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Tue, 4 Jun 2024 17:00:04 +0200 Subject: [PATCH 02/12] Update release-test-macos.yml --- .github/workflows/release-test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index adb42f37d3..c28bfed13b 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -35,7 +35,7 @@ jobs: APP_NAME: Lapce-macos-${{ matrix.rust-arch }}.app DMG_NAME: lapce-macos-${{ matrix.rust-arch }}.dmg - CARGO_BUILD_TARGET: ${{ matrix.rust-arch }}-apple-darwin + # CARGO_BUILD_TARGET: ${{ matrix.rust-arch }}-apple-darwin steps: - uses: actions/checkout@v4 From f69e190ff81302dd8d71f181ac23c5d4d629b81c Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Tue, 4 Jun 2024 17:21:59 +0200 Subject: [PATCH 03/12] Update release-test-macos.yml --- .github/workflows/release-test-macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index c28bfed13b..7f3ddf086a 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -1,4 +1,4 @@ -name: Release +name: Release Test on: pull_request: @@ -76,5 +76,5 @@ jobs: with: name: lapce-macos-${{ matrix.rust-arch }} path: | - ./target/release-lto/macos/${{ env.DMG_NAME }}.dmg + ./target/release-lto/macos/${{ env.DMG_NAME }} retention-days: 1 From b8d2faa68d6eb98a61b92a512d1d4623790bc98e Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Tue, 4 Jun 2024 17:56:33 +0200 Subject: [PATCH 04/12] Update Makefile --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1304573bb3..2fec707a2e 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ CODESIGN_IDENTITY = FAC8FBEA99169DC1980731029648F110628D6A32 ASSETS_DIR = extra RELEASE_DIR = target/release-lto +MACOSX_DEPLOYMENT_TARGET ?= 10.11 + APP_NAME = Lapce.app APP_TEMPLATE = $(ASSETS_DIR)/macos/$(APP_NAME) APP_DIR = $(RELEASE_DIR)/macos @@ -31,11 +33,11 @@ ubuntu-deps: binary: $(TARGET)-native ## Build a release binary binary-universal: $(TARGET)-universal ## Build a universal release binary $(TARGET)-native: - MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --profile release-lto + cargo build --profile release-lto @lipo target/release-lto/$(TARGET) -create -output $(APP_BINARY) $(TARGET)-universal: MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --profile release-lto --target=x86_64-apple-darwin - MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --profile release-lto --target=aarch64-apple-darwin + MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=aarch64-apple-darwin @lipo target/{x86_64,aarch64}-apple-darwin/release-lto/$(TARGET) -create -output $(APP_BINARY) /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY) From 073534a12cd55e76bb7422700307845e63b134ea Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Tue, 4 Jun 2024 17:58:01 +0200 Subject: [PATCH 05/12] Update release-test-macos.yml --- .github/workflows/release-test-macos.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index 7f3ddf086a..dd5e5f02cd 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -51,8 +51,13 @@ jobs: - name: Fetch dependencies run: cargo fetch --locked + - name: arm64 + if: matrix.rust-arch == 'aarch64' + run: echo 'MACOSX_DEPLOYMENT_TARGET=11.0' >> $GITHUB_ENV + - name: Make DMG run: make dmg + MACOSX_DEPLOYMENT_TARGET: - name: Rename run: | From d8633072b08541321ecccd2e0255b849a7b70e68 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Tue, 4 Jun 2024 17:58:31 +0200 Subject: [PATCH 06/12] Update release-test-macos.yml --- .github/workflows/release-test-macos.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index dd5e5f02cd..1080f17f3d 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -57,7 +57,6 @@ jobs: - name: Make DMG run: make dmg - MACOSX_DEPLOYMENT_TARGET: - name: Rename run: | From acf50362202cdd1241e0b24d11e6a40cabf418a7 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 4 Jun 2024 18:34:19 +0100 Subject: [PATCH 07/12] update --- .github/workflows/release-test-macos.yml | 10 +--------- Makefile | 4 +--- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index 1080f17f3d..b6d2d672b8 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -22,10 +22,6 @@ jobs: - rust-arch: aarch64 darwin-arch: arm64 runs-on: macos-14 - - - rust-arch: x86_64 - darwin-arch: x86_64 - runs-on: macos-13 env: RELEASE_TAG_NAME: ${{ needs.tagname.outputs.tag_name }} @@ -51,12 +47,8 @@ jobs: - name: Fetch dependencies run: cargo fetch --locked - - name: arm64 - if: matrix.rust-arch == 'aarch64' - run: echo 'MACOSX_DEPLOYMENT_TARGET=11.0' >> $GITHUB_ENV - - name: Make DMG - run: make dmg + run: make dmg-universal - name: Rename run: | diff --git a/Makefile b/Makefile index 2fec707a2e..21b4f40f28 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,6 @@ CODESIGN_IDENTITY = FAC8FBEA99169DC1980731029648F110628D6A32 ASSETS_DIR = extra RELEASE_DIR = target/release-lto -MACOSX_DEPLOYMENT_TARGET ?= 10.11 - APP_NAME = Lapce.app APP_TEMPLATE = $(ASSETS_DIR)/macos/$(APP_NAME) APP_DIR = $(RELEASE_DIR)/macos @@ -36,7 +34,7 @@ $(TARGET)-native: cargo build --profile release-lto @lipo target/release-lto/$(TARGET) -create -output $(APP_BINARY) $(TARGET)-universal: - MACOSX_DEPLOYMENT_TARGET="10.11" cargo build --profile release-lto --target=x86_64-apple-darwin + MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=x86_64-apple-darwin MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=aarch64-apple-darwin @lipo target/{x86_64,aarch64}-apple-darwin/release-lto/$(TARGET) -create -output $(APP_BINARY) /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY) From 40837c61a8197e3485197a984b914464efe58638 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 4 Jun 2024 18:36:56 +0100 Subject: [PATCH 08/12] update --- .github/workflows/release-test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index b6d2d672b8..08b25c58fd 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v4 - name: Update rust - run: rustup update + run: rustup update && rustup target add aarch64-apple-darwin - name: Import Certificate uses: Apple-Actions/import-codesign-certs@v3 From 0d21844889ffe4f52cce4bdf7a41691e940cac7e Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 4 Jun 2024 18:38:53 +0100 Subject: [PATCH 09/12] update --- .github/workflows/release-test-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index 08b25c58fd..a12a87f3c4 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v4 - name: Update rust - run: rustup update && rustup target add aarch64-apple-darwin + run: rustup update && rustup target add x86_64-apple-darwin - name: Import Certificate uses: Apple-Actions/import-codesign-certs@v3 From e7f7c13ab8bc4770aacb98de868495ee3f4ea25c Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 4 Jun 2024 19:08:21 +0100 Subject: [PATCH 10/12] update --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 21b4f40f28..f106cf62ce 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(TARGET)-universal: MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=x86_64-apple-darwin MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=aarch64-apple-darwin @lipo target/{x86_64,aarch64}-apple-darwin/release-lto/$(TARGET) -create -output $(APP_BINARY) - /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY) + /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY) app: $(APP_NAME)-native ## Create a Lapce.app app-universal: $(APP_NAME)-universal ## Create a universal Lapce.app @@ -50,7 +50,7 @@ $(APP_NAME)-%: $(TARGET)-% @echo "Created '$(APP_NAME)' in '$(APP_DIR)'" xattr -c $(APP_DIR)/$(APP_NAME)/Contents/Info.plist xattr -c $(APP_DIR)/$(APP_NAME)/Contents/Resources/lapce.icns - /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(APP_DIR)/$(APP_NAME) + /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_DIR)/$(APP_NAME) dmg: $(DMG_NAME)-native ## Create a Lapce.dmg dmg-universal: $(DMG_NAME)-universal ## Create a universal Lapce.dmg @@ -63,7 +63,7 @@ $(DMG_NAME)-%: $(APP_NAME)-% -srcfolder $(APP_DIR) \ -ov -format UDZO @echo "Packed '$(APP_NAME)' in '$(APP_DIR)'" - /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --strict --options=runtime --force -s $(CODESIGN_IDENTITY) $(DMG_DIR)/$(DMG_NAME) + /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(DMG_DIR)/$(DMG_NAME) install: $(INSTALL)-native ## Mount disk image install-universal: $(INSTALL)-native ## Mount universal disk image From 838efd69765ebc180909086edfe4bebf19529721 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 4 Jun 2024 20:53:32 +0100 Subject: [PATCH 11/12] update --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f106cf62ce..ef42b0413d 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ $(TARGET)-universal: MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=x86_64-apple-darwin MACOSX_DEPLOYMENT_TARGET="11.0" cargo build --profile release-lto --target=aarch64-apple-darwin @lipo target/{x86_64,aarch64}-apple-darwin/release-lto/$(TARGET) -create -output $(APP_BINARY) - /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY) + /usr/bin/codesign -vvv --deep --timestamp --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_BINARY) app: $(APP_NAME)-native ## Create a Lapce.app app-universal: $(APP_NAME)-universal ## Create a universal Lapce.app @@ -50,7 +50,7 @@ $(APP_NAME)-%: $(TARGET)-% @echo "Created '$(APP_NAME)' in '$(APP_DIR)'" xattr -c $(APP_DIR)/$(APP_NAME)/Contents/Info.plist xattr -c $(APP_DIR)/$(APP_NAME)/Contents/Resources/lapce.icns - /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_DIR)/$(APP_NAME) + /usr/bin/codesign -vvv --deep --timestamp --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(APP_DIR)/$(APP_NAME) dmg: $(DMG_NAME)-native ## Create a Lapce.dmg dmg-universal: $(DMG_NAME)-universal ## Create a universal Lapce.dmg @@ -63,7 +63,7 @@ $(DMG_NAME)-%: $(APP_NAME)-% -srcfolder $(APP_DIR) \ -ov -format UDZO @echo "Packed '$(APP_NAME)' in '$(APP_DIR)'" - /usr/bin/codesign -vvv --deep --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(DMG_DIR)/$(DMG_NAME) + /usr/bin/codesign -vvv --deep --timestamp --entitlements $(ASSETS_DIR)/entitlements.plist --options runtime --force -s $(CODESIGN_IDENTITY) $(DMG_DIR)/$(DMG_NAME) install: $(INSTALL)-native ## Mount disk image install-universal: $(INSTALL)-native ## Mount universal disk image From 5af119fa2bd00db0d1a26907bcf460cc155178df Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 4 Jun 2024 21:29:16 +0100 Subject: [PATCH 12/12] update --- .github/workflows/release-test-macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml index a12a87f3c4..1ae9242a15 100644 --- a/.github/workflows/release-test-macos.yml +++ b/.github/workflows/release-test-macos.yml @@ -21,7 +21,7 @@ jobs: include: - rust-arch: aarch64 darwin-arch: arm64 - runs-on: macos-14 + runs-on: macos-12 env: RELEASE_TAG_NAME: ${{ needs.tagname.outputs.tag_name }} @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v4 - name: Update rust - run: rustup update && rustup target add x86_64-apple-darwin + run: rustup update && rustup target add aarch64-apple-darwin - name: Import Certificate uses: Apple-Actions/import-codesign-certs@v3