-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0683af2
commit 27fac1d
Showing
3 changed files
with
91 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,76 @@ | ||
name: Flutter Desktop CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-macos: | ||
name: "Build MacOS" | ||
runs-on: macos-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Set up Flutter environment | ||
- name: Set up Flutter | ||
uses: subosito/[email protected] | ||
with: | ||
channel: stable | ||
cache: true | ||
- name: Set Up XCode | ||
uses: BoundfoxStudios/action-xcode-select@v1 | ||
|
||
# Step 3: Install dependencies | ||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
# Step 4: Build the Flutter app for desktop | ||
- name: Build Desktop App | ||
run: flutter build macos --build-number=${{ github.run_number }} | ||
- name: Install create-dmg | ||
run: brew install create-dmg | ||
- name: Create dmg | ||
run: | | ||
chmod +x scripts/create_dmg.sh | ||
./scripts/create_dmg.sh | ||
- name: Compress artifacts | ||
run: zip -r macos-dev.zip build/macos/Build/Products/Release | ||
|
||
# Step 5: Upload build artifacts | ||
- name: Upload Build DMG | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: focusmate-macos-dev.dmg | ||
path: build/macos/Build/Products/Release/FocusMate.dmg | ||
- name: Upload Build Zip | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: focusmate-macos-dev.zip | ||
path: macos-dev.zip | ||
|
||
# Step 6: Create Release | ||
- name: release | ||
uses: ncipollo/release-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag: v1.0.0-${{ github.run_number }} | ||
name: "Release ${{ github.run_number }}" | ||
draft: false | ||
prerelease: false | ||
artifacts: | | ||
build/macos/Build/Products/Release/FocusMate.dmg | ||
macos-dev.zip | ||
artifact_content_type: | | ||
application/x-apple-diskimage | ||
application/zip |
Binary file not shown.
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,15 @@ | ||
#!/bin/sh | ||
test -f focusmate.dmg && rm focusmate.dmg | ||
create-dmg \ | ||
--volname "FocusMate Installer" \ | ||
--volicon "./assets/focusmate_installer.icns" \ | ||
--window-pos 200 120 \ | ||
--window-size 800 530 \ | ||
--icon-size 130 \ | ||
--text-size 14 \ | ||
--icon "focus_mate.app" 260 250 \ | ||
--hide-extension "focus_mate.app" \ | ||
--app-drop-link 540 250 \ | ||
--hdiutil-quiet \ | ||
"build/macos/Build/Products/Release/FocusMate.dmg" \ | ||
"build/macos/Build/Products/Release/focus_mate.app" |