diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml index a188c504..df08c4a4 100644 --- a/.github/workflows/build_publish.yml +++ b/.github/workflows/build_publish.yml @@ -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 }} @@ -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: | diff --git a/changelog/v6.6.6+123.md b/changelog/v6.6.6+123.md index 656cf303..9279114a 100644 --- a/changelog/v6.6.6+123.md +++ b/changelog/v6.6.6+123.md @@ -1,5 +1,5 @@ -1. macOS安装包格式改为.pkg +1. macOS安装包格式改为.dmg ------------------------------------------------------------------------------------------ -1. Distribute .pkg file for macOS +1. Distribute .dmg file for macOS diff --git a/dmg.sh b/dmg.sh index c1c10e84..6b14526c 100644 --- a/dmg.sh +++ b/dmg.sh @@ -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 \ No newline at end of file diff --git a/pkg.sh b/pkg.sh new file mode 100644 index 00000000..c1c10e84 --- /dev/null +++ b/pkg.sh @@ -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