diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml new file mode 100644 index 0000000..802fa61 --- /dev/null +++ b/.github/workflows/macos_build.yml @@ -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 }}