Skip to content

Commit

Permalink
macos dmg build
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-jiao committed Feb 27, 2024
1 parent 60c677a commit 7dae26f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,31 @@ jobs:
name: Renamer-${{github.ref_name}}-windows.zip
path: build/windows/x64/runner/Release

build-and-release-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
flutter-version: '3.19.1'
- name: Install project dependencies
run: flutter pub get
- name: Enable macOS build
run: flutter config --enable-macos-desktop
- name: Build artifacts
run: flutter build macos --release
- name: install npm
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: install appdmg
run: npm install -g appdmg
- name: build dmg
run: appdmg ./dmg/config.json ./build/macos/Build/Products/Release/
- name: macOS Release
uses: actions/upload-artifact@v4
with:
name: Renamer-${{github.ref_name}}-macos.zip
path: build/macos/Build/Products/Release

8 changes: 8 additions & 0 deletions dmg/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": "Renamer",
"icon": "./assets/desktop.png",
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "./build/macos/Build/Products/Release/APP_NAME.app" }
]
}

0 comments on commit 7dae26f

Please sign in to comment.