@@ -128,9 +128,9 @@ jobs:
128128 runs-on : ${{ matrix.job.os }}
129129 needs : create-release
130130 env :
131- MACOS_APP_RELEASE_PATH : frontend/appflowy_flutter/product /${{ github.ref_name }}/macos/Release
131+ MACOS_APP_RELEASE_PATH : frontend/appflowy_flutter/build /${{ github.ref_name }}
132132 MACOS_X86_ZIP_NAME : AppFlowy-${{ github.ref_name }}-macos-x86_64.zip
133- MACOS_DMG_NAME : AppFlowy-${{ github.ref_name }}-macos-x86_64
133+ MACOS_DMG_NAME : AppFlowy-${{ github.ref_name }}-macos-x86_64.dmg
134134 strategy :
135135 fail-fast : false
136136 matrix :
@@ -158,55 +158,93 @@ jobs:
158158 - name : Install prerequisites
159159 working-directory : frontend
160160 run : |
161+ brew install p7zip
161162 cargo install --force --locked cargo-make
162163 cargo install --force --locked duckscript_cli
163164
164165 - name : Build AppFlowy
165166 working-directory : frontend
166167 run : |
167168 flutter config --enable-macos-desktop
168- dart ./scripts/flutter_release_build/build_flowy.dart run . ${{ github.ref_name }}
169+ flutter pub global activate flutter_distributor
170+ sh scripts/flutter_release_build/build_macos.sh --build_type dmg --build_arch x86_64 --version ${{ github.ref_name }} --apple-id ${{ secrets.MACOS_NOTARY_USER }} --team-id ${{ secrets.MACOS_TEAM_ID }} --password ${{ secrets.MACOS_NOTARY_PWD }}
169171
170- - name : Codesign AppFlowy
171- run : |
172- echo ${{ secrets.MACOS_CERTIFICATE }} | base64 --decode > certificate.p12
173- security create-keychain -p action build.keychain
174- security default-keychain -s build.keychain
175- security unlock-keychain -p action build.keychain
176- security import certificate.p12 -k build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign
177- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k action build.keychain
178- /usr/bin/codesign --force --options runtime --deep --sign "${{ secrets.MACOS_CODESIGN_ID }}" "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" -v
179-
180- - name : Create macOS dmg
181- run : |
182- brew install create-dmg
183- create-dmg \
184- --volname ${{ env.MACOS_DMG_NAME }} \
185- --hide-extension "AppFlowy.app" \
186- --background frontend/scripts/dmg_assets/AppFlowyInstallerBackground.jpg \
187- --window-size 600 450 \
188- --icon-size 94 \
189- --icon "AppFlowy.app" 141 249 \
190- --app-drop-link 458 249 \
191- "${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg" \
192- "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app"
193-
194- - name : Notarize AppFlowy
172+ - name : Upload Asset
173+ uses : actions/upload-release-asset@v1
174+ env :
175+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
176+ with :
177+ upload_url : ${{ needs.create-release.outputs.upload_url }}
178+ asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }}
179+ asset_name : ${{ env.MACOS_X86_ZIP_NAME }}
180+ asset_content_type : application/octet-stream
181+
182+ - name : Upload DMG Asset
183+ uses : actions/upload-release-asset@v1
184+ env :
185+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
186+ with :
187+ upload_url : ${{ needs.create-release.outputs.upload_url }}
188+ asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}
189+ asset_name : ${{ env.MACOS_DMG_NAME }}
190+ asset_content_type : application/octet-stream
191+
192+ build-for-macOS-arm64 :
193+ name : ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}]
194+ runs-on : ${{ matrix.job.os }}
195+ needs : create-release
196+ env :
197+ MACOS_APP_RELEASE_PATH : frontend/appflowy_flutter/product/${{ github.ref_name }}/macos/Release
198+ MACOS_AARCH64_ZIP_NAME : AppFlowy-${{ github.ref_name }}-macos-arm64.zip
199+ MACOS_DMG_NAME : AppFlowy-${{ github.ref_name }}-macos-arm64.dmg
200+ strategy :
201+ fail-fast : false
202+ matrix :
203+ job :
204+ - {
205+ targets : " aarch64-apple-darwin" ,
206+ os : macos-latest,
207+ extra-build-args : " " ,
208+ }
209+ steps :
210+ - name : Checkout source code
211+ uses : actions/checkout@v4
212+
213+ - name : Install flutter
214+ uses : subosito/flutter-action@v2
215+ with :
216+ channel : " stable"
217+ flutter-version : ${{ env.FLUTTER_VERSION }}
218+
219+ - name : Install Rust toolchain
220+ uses : dtolnay/rust-toolchain@stable
221+ with :
222+ toolchain : ${{ env.RUST_TOOLCHAIN }}
223+ targets : ${{ matrix.job.targets }}
224+ components : rustfmt
225+
226+ - name : Install prerequisites
227+ working-directory : frontend
195228 run : |
196- 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
229+ brew install p7zip
230+ cargo install --force --locked cargo-make
231+ cargo install --force --locked duckscript_cli
197232
198- - name : Archive Asset
199- working-directory : ${{ env.MACOS_APP_RELEASE_PATH }}
200- run : zip --symlinks -qr ${{ env.MACOS_X86_ZIP_NAME }} AppFlowy.app
233+ - name : Build AppFlowy
234+ working-directory : frontend
235+ run : |
236+ flutter config --enable-macos-desktop
237+ dart pub global activate flutter_distributor
238+ sh scripts/flutter_release_build/build_macos.sh --build_type dmg --build_arch arm64 --version ${{ github.ref_name }} --apple-id ${{ secrets.MACOS_NOTARY_USER }} --team-id ${{ secrets.MACOS_TEAM_ID }} --password ${{ secrets.MACOS_NOTARY_PWD }}
201239
202240 - name : Upload Asset
203241 uses : actions/upload-release-asset@v1
204242 env :
205243 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
206244 with :
207245 upload_url : ${{ needs.create-release.outputs.upload_url }}
208- asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }}
209- asset_name : ${{ env.MACOS_X86_ZIP_NAME }}
246+ asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_AARCH64_ZIP_NAME }}
247+ asset_name : ${{ env.MACOS_AARCH64_ZIP_NAME }}
210248 asset_content_type : application/octet-stream
211249
212250 - name : Upload DMG Asset
@@ -215,8 +253,8 @@ jobs:
215253 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
216254 with :
217255 upload_url : ${{ needs.create-release.outputs.upload_url }}
218- asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg
219- asset_name : ${{ env.MACOS_DMG_NAME }}.dmg
256+ asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}
257+ asset_name : ${{ env.MACOS_DMG_NAME }}
220258 asset_content_type : application/octet-stream
221259
222260 build-for-macOS-universal :
@@ -226,7 +264,7 @@ jobs:
226264 env :
227265 MACOS_APP_RELEASE_PATH : frontend/appflowy_flutter/product/${{ github.ref_name }}/macos/Release
228266 MACOS_AARCH64_ZIP_NAME : AppFlowy-${{ github.ref_name }}-macos-universal.zip
229- MACOS_DMG_NAME : AppFlowy-${{ github.ref_name }}-macos-universal
267+ MACOS_DMG_NAME : AppFlowy-${{ github.ref_name }}-macos-universal.dmg
230268 strategy :
231269 fail-fast : false
232270 matrix :
@@ -256,46 +294,16 @@ jobs:
256294 - name : Install prerequisites
257295 working-directory : frontend
258296 run : |
297+ brew install p7zip
259298 cargo install --force --locked cargo-make
260299 cargo install --force --locked duckscript_cli
261300
262301 - name : Build AppFlowy
263302 working-directory : frontend
264303 run : |
265304 flutter config --enable-macos-desktop
266- sh scripts/flutter_release_build/build_universal_package_for_macos.sh ${{ github.ref_name }}
267-
268- - name : Codesign AppFlowy
269- run : |
270- echo ${{ secrets.MACOS_CERTIFICATE }} | base64 --decode > certificate.p12
271- security create-keychain -p action build.keychain
272- security default-keychain -s build.keychain
273- security unlock-keychain -p action build.keychain
274- security import certificate.p12 -k build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign
275- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k action build.keychain
276- /usr/bin/codesign --force --options runtime --deep --sign "${{ secrets.MACOS_CODESIGN_ID }}" "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" -v
277-
278- - name : Create macOS dmg
279- run : |
280- brew install create-dmg
281- create-dmg \
282- --volname ${{ env.MACOS_DMG_NAME }} \
283- --hide-extension "AppFlowy.app" \
284- --background frontend/scripts/dmg_assets/AppFlowyInstallerBackground.jpg \
285- --window-size 600 450 \
286- --icon-size 94 \
287- --icon "AppFlowy.app" 141 249 \
288- --app-drop-link 458 249 \
289- "${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg" \
290- "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app"
291-
292- - name : Notarize AppFlowy
293- run : |
294- 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
295-
296- - name : Archive Asset
297- working-directory : ${{ env.MACOS_APP_RELEASE_PATH }}
298- run : zip --symlinks -qr ${{ env.MACOS_AARCH64_ZIP_NAME }} AppFlowy.app
305+ dart pub global activate flutter_distributor
306+ sh scripts/flutter_release_build/build_macos.sh --build_type dmg --build_arch universal --version ${{ github.ref_name }} --apple-id ${{ secrets.MACOS_NOTARY_USER }} --team-id ${{ secrets.MACOS_TEAM_ID }} --password ${{ secrets.MACOS_NOTARY_PWD }}
299307
300308 - name : Upload Asset
301309 uses : actions/upload-release-asset@v1
@@ -313,8 +321,8 @@ jobs:
313321 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
314322 with :
315323 upload_url : ${{ needs.create-release.outputs.upload_url }}
316- asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg
317- asset_name : ${{ env.MACOS_DMG_NAME }}.dmg
324+ asset_path : ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}
325+ asset_name : ${{ env.MACOS_DMG_NAME }}
318326 asset_content_type : application/octet-stream
319327
320328 build-for-linux :
0 commit comments