Skip to content

Commit

Permalink
chore: add keychain in release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Feb 20, 2025
1 parent b663396 commit d2268ee
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
12 changes: 12 additions & 0 deletions frontend/scripts/flutter_release_build/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d2268ee

Please sign in to comment.