-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add macOS build and release workflow
- Loading branch information
sagar
committed
Nov 16, 2024
1 parent
8d4a6a8
commit 1f80286
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: macOS Build and Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.10.0' | ||
channel: 'stable' | ||
architecture: x64 | ||
|
||
- name: Install create-dmg | ||
run: brew install create-dmg | ||
|
||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Build macOS | ||
run: flutter build macos --release | ||
|
||
- name: Create DMG | ||
run: | | ||
APP_NAME="todo_app" | ||
DMG_NAME="${APP_NAME}_macos.dmg" | ||
# Create DMG | ||
create-dmg \ | ||
--volname "$APP_NAME" \ | ||
--window-pos 200 120 \ | ||
--window-size 800 400 \ | ||
--icon-size 100 \ | ||
--app-drop-link 600 185 \ | ||
"$DMG_NAME" \ | ||
"build/macos/Build/Products/Release/$APP_NAME.app" | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
todo_app_macos.dmg | ||
draft: false | ||
prerelease: false | ||
generate_release_notes: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |