Skip to content

Commit

Permalink
Distribute .dmg file for macOS
Browse files Browse the repository at this point in the history
macOS安装包格式改为.dmg
  • Loading branch information
jiangtian616 committed Mar 23, 2023
1 parent 2aea883 commit 5e6cde3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
cache_pod_path: macos/Pods
cache_pod_restore_keys_hash_file: macos/Podfile.lock
artifact_name: release-macOS
artifact_path: build/macos/*.pkg
artifact_path: /Users/runner/work/JHenTai/JHenTai/*.dmg
outputs:
version: ${{ steps.get_version.outputs.version }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
mkdir -p Payload
mv ios/iphoneos/*.app Payload
zip -9 JHenTai_${{ steps.get_version.outputs.version }}.ipa -r Payload
# Build macOS .zip
# Build macOS .dmg
- name: Build macOS
if: matrix.target == 'macOS'
run: |
Expand Down
4 changes: 2 additions & 2 deletions changelog/v6.6.6+123.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1. macOS安装包格式改为.pkg
1. macOS安装包格式改为.dmg

------------------------------------------------------------------------------------------

1. Distribute .pkg file for macOS
1. Distribute .dmg file for macOS
7 changes: 2 additions & 5 deletions dmg.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
version=$(head -n 5 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2)

flutter build macos --release -t lib/src/main.dart \
&& hdiutil create -size 150m -fs HFS+ -volname JHenTai JHenTai.dmg \
&& hdiutil attach JHenTai.dmg \
&& cp -R build/macos/Build/Products/Release/jhentai.app /Volumes/JHenTai \
&& pkgbuild --install-location /Applications/JHenTai.app --identifier top.jtmonster.jhentai --version ${version} --root /Volumes/JHenTai/jhentai.app build/macos/JHenTai-${version}.pkg \
&& hdiutil detach /Volumes/JHenTai
&& brew install create-dmg \
&& create-dmg --volname JHenTai-${version} --window-pos 200 120 --window-size 800 450 --icon-size 100 --app-drop-link 600 185 JHenTai-${version}.dmg build/macos/Build/Products/Release/jhentai.app
8 changes: 8 additions & 0 deletions pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version=$(head -n 5 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2)

flutter build macos --release -t lib/src/main.dart \
&& hdiutil create -size 150m -fs HFS+ -volname JHenTai JHenTai.dmg \
&& hdiutil attach JHenTai.dmg \
&& cp -R build/macos/Build/Products/Release/jhentai.app /Volumes/JHenTai \
&& pkgbuild --install-location /Applications/JHenTai.app --identifier top.jtmonster.jhentai --version ${version} --root /Volumes/JHenTai/jhentai.app build/macos/JHenTai-${version}.pkg \
&& hdiutil detach /Volumes/JHenTai

0 comments on commit 5e6cde3

Please sign in to comment.