diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9c7cc5f15244..9c0d65b0d67a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -162,6 +162,15 @@ jobs: cargo install --force --locked cargo-make cargo install --force --locked duckscript_cli + - name: Add codesign certificate + 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 + - name: Build AppFlowy working-directory: frontend run: | @@ -230,6 +239,15 @@ jobs: cargo install --force --locked cargo-make cargo install --force --locked duckscript_cli + - name: Add codesign certificate + 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 + - name: Build AppFlowy working-directory: frontend run: | @@ -298,6 +316,15 @@ jobs: cargo install --force --locked cargo-make cargo install --force --locked duckscript_cli + - name: Add codesign certificate + 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 + - name: Build AppFlowy working-directory: frontend run: | diff --git a/frontend/scripts/flutter_release_build/build_macos.sh b/frontend/scripts/flutter_release_build/build_macos.sh index 653b28031b094..51f73e2ecf3bd 100755 --- a/frontend/scripts/flutter_release_build/build_macos.sh +++ b/frontend/scripts/flutter_release_build/build_macos.sh @@ -219,6 +219,12 @@ build_dmg() { exit 1 fi + # check if the appdmg has been installed + if ! command -v appdmg &>/dev/null; then + info "appdmg is not installed. Installing appdmg..." + npm install -g appdmg + fi + # step 3: build the dmg package using appdmg # note: You must install the appdmg to the system before building the dmg package appdmg appflowy_flutter/build/$VERSION/make_config.json appflowy_flutter/build/$VERSION/AppFlowy-$VERSION-macos-$BUILD_ARCH.dmg @@ -227,6 +233,12 @@ build_dmg() { rm -rf appflowy_flutter/build/$VERSION/AppFlowy.app rm -rf appflowy_flutter/build/$VERSION/make_config.json + # check if the dmg package is built + if [ ! -f "appflowy_flutter/build/$VERSION/AppFlowy-$VERSION-macos-$BUILD_ARCH.dmg" ]; then + error "DMG package is not built. Please check the build process." + exit 1 + fi + info "DMG package built successfully. The dmg package is located at appflowy_flutter/build/$VERSION/AppFlowy-$VERSION-macos-$BUILD_ARCH.dmg" if [ -z "$APPLE_ID" ] || [ -z "$TEAM_ID" ] || [ -z "$PASSWORD" ]; then