diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a01d13d6d60..8fbfcc8a7b4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -174,6 +174,16 @@ jobs: flutter config --enable-macos-desktop dart ./scripts/flutter_release_build/build_flowy.dart . ${{ github.ref_name }} + - name: Codesign AppFlowy + run: | + echo ${{ secrets.MACOS_CERTIFICATE }} | base64 --decode > certificate.p12 + security create-keychain -p action build.keychain + security default-keychain -s build.keychain + security unlock-keychain -p action build.keychain + security import certificate.p12 -k build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k action build.keychain + /usr/bin/codesign --force --options runtime --deep --sign "${{ secrets.MACOS_CODESIGN_ID }}" "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" -v + - name: Create macOS dmg run: | brew install create-dmg @@ -188,6 +198,10 @@ jobs: "${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg" \ "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" + - name: Notarize AppFlowy + run: | + xcrun notarytool submit ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg --apple-id ${{ secrets.MACOS_NOTARY_USER }} --team-id ${{ secrets.MACOS_TEAM_ID }} --password ${{ secrets.MACOS_NOTARY_PWD }} -v -f "json" --wait + - name: Archive Asset working-directory: ${{ env.MACOS_APP_RELEASE_PATH }} run: zip --symlinks -qr ${{ env.MACOS_X86_ZIP_NAME }} AppFlowy.app @@ -264,6 +278,16 @@ jobs: flutter config --enable-macos-desktop sh scripts/flutter_release_build/build_universal_package_for_macos.sh + - name: Codesign AppFlowy + run: | + echo ${{ secrets.MACOS_CERTIFICATE }} | base64 --decode > certificate.p12 + security create-keychain -p action build.keychain + security default-keychain -s build.keychain + security unlock-keychain -p action build.keychain + security import certificate.p12 -k build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k action build.keychain + /usr/bin/codesign --force --options runtime --deep --sign "${{ secrets.MACOS_CODESIGN_ID }}" "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" -v + - name: Create macOS dmg run: | brew install create-dmg @@ -278,6 +302,10 @@ jobs: "${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg" \ "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" + - name: Notarize AppFlowy + run: | + xcrun notarytool submit ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg --apple-id ${{ secrets.MACOS_NOTARY_USER }} --team-id ${{ secrets.MACOS_TEAM_ID }} --password ${{ secrets.MACOS_NOTARY_PWD }} -v -f "json" --wait + - name: Archive Asset working-directory: ${{ env.MACOS_APP_RELEASE_PATH }} run: zip --symlinks -qr ${{ env.MACOS_AARCH64_ZIP_NAME }} AppFlowy.app diff --git a/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj b/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj index d5f075f41ad5..09c21597d3d4 100644 --- a/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj +++ b/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj @@ -427,6 +427,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + ENABLE_HARDENED_RUNTIME = YES; EXCLUDED_ARCHS = ""; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AppFlowy; @@ -563,6 +564,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + ENABLE_HARDENED_RUNTIME = YES; EXCLUDED_ARCHS = ""; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AppFlowy; @@ -590,6 +592,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + ENABLE_HARDENED_RUNTIME = YES; EXCLUDED_ARCHS = ""; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AppFlowy; diff --git a/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements b/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements index 526b08b5bf19..71949adefe79 100644 --- a/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements +++ b/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements @@ -4,8 +4,6 @@ com.apple.security.app-sandbox - com.apple.security.cs.allow-jit - com.apple.security.files.downloads.read-write com.apple.security.files.user-selected.read-write