Skip to content

Commit

Permalink
Add macOS build and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar committed Nov 16, 2024
1 parent 8d4a6a8 commit 1f80286
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/macos_build.yml
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 }}

0 comments on commit 1f80286

Please sign in to comment.