-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (67 loc) · 2.01 KB
/
flutter_desktop_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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