Skip to content

Commit

Permalink
ci: macos code sign
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Nov 19, 2023
1 parent 1572ec1 commit e69b7c9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ jobs:
env:
MACOS_APP_RELEASE_PATH: frontend/appflowy_flutter/product/${{ needs.prepare.outputs.version }}/macos/Release
MACOS_DMG_NAME: ${{ matrix.environment }}_AppFlowy_${{ github.ref_name }}_macos-x86_64
MACOS_CODESIGN_ID: ${{ secrets.MACOS_CODESIGN_ID }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
Expand Down Expand Up @@ -203,15 +204,24 @@ jobs:
flutter config --enable-macos-desktop
dart ./scripts/flutter_release_build/build_flowy.dart run . ${{ needs.prepare.outputs.version }}
- name: Check for Code signing ID
run: |
if [ -z "${{ env.MACOS_CODESIGN_ID }}" ]; then
echo "MACOS_CODESIGN_ID is not set. Skipping code signing step."
else
echo "MACOS_CODESIGN_ID is set. Proceeding with code signing."
fi
- name: Codesign AppFlowy
if: env.MACOS_CODESIGN_ID != ''
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
/usr/bin/codesign --force --options runtime --deep --sign "${{ env.MACOS_CODESIGN_ID }}" "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" -v
- name: Create macOS dmg
run: |
Expand Down

0 comments on commit e69b7c9

Please sign in to comment.