Skip to content

Commit a50f2a6

Browse files
authored
ci: Add dmg support for MacOS and add the .dmg to the release (#1401)
1 parent cd8e4dd commit a50f2a6

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ jobs:
8787
env:
8888
MACOS_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/macos/Release
8989
MACOS_X86_ZIP_NAME: Appflowy-macos-x86_64.zip
90+
MACOS_DMG_NAME: Appflowy-macos-x86_64-installer
9091
steps:
9192
- name: Checkout
9293
uses: actions/checkout@v2
@@ -116,6 +117,21 @@ jobs:
116117
flutter config --enable-macos-desktop
117118
cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-mac-x86_64 appflowy
118119
120+
- name: Create MacOS dmg
121+
working-directory: frontend
122+
run: |
123+
brew install create-dmg
124+
create-dmg \
125+
--volname ${{ env.MACOS_DMG_NAME }} \
126+
--hide-extension "AppFlowy.app" \
127+
--background scripts/dmg_assets/AppFlowyInstallerBackground.jpg \
128+
--window-size 600 450 \
129+
--icon-size 94 \
130+
--icon "AppFlowy.app" 141 249 \
131+
--app-drop-link 458 249 \
132+
"${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg" \
133+
"${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app"
134+
119135
- name: Archive macOS app
120136
working-directory: ${{ env.MACOS_APP_RELEASE_PATH }}
121137
run: zip --symlinks -qr ${{ env.MACOS_X86_ZIP_NAME }} AppFlowy.app
@@ -129,6 +145,15 @@ jobs:
129145
asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }}
130146
asset_name: ${{ env.MACOS_X86_ZIP_NAME }}
131147
asset_content_type: application/octet-stream
148+
- name: Upload DMG Release Asset
149+
uses: actions/upload-release-asset@v1
150+
env:
151+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152+
with:
153+
upload_url: ${{ needs.create-release.outputs.upload_url }}
154+
asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg
155+
asset_name: ${{ env.MACOS_DMG_NAME }}.dmg
156+
asset_content_type: application/octet-stream
132157

133158
build-windows-x86_64:
134159
runs-on: windows-latest
20.1 KB
Loading

0 commit comments

Comments
 (0)