diff --git a/.github/workflows/release-test-macos.yml b/.github/workflows/release-test-macos.yml new file mode 100644 index 0000000000..1ae9242a15 --- /dev/null +++ b/.github/workflows/release-test-macos.yml @@ -0,0 +1,76 @@ +name: Release Test + +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-12 + 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 && rustup target add aarch64-apple-darwin + + - 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-universal + + - 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 }} + retention-days: 1 diff --git a/Makefile b/Makefile index 1304573bb3..ef42b0413d 100644 --- a/Makefile +++ b/Makefile @@ -31,13 +31,13 @@ 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=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 --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 --strict --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 --strict --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