-
Notifications
You must be signed in to change notification settings - Fork 3
152 lines (126 loc) · 4.1 KB
/
publish.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Publish Windows, MacOS, and Android
# Builds a Windows App Installer (.msix) for the Dashboard
#
# To use this action, add your Windows Certificate file, in base64 format, to a
# repository secret called WINDOWS_CERTIFICATE. This action then:
# - Installs Flutter and clones your repository
# - Decodes your text certificate into a binary .pfx file
# - Runs flutter pub run msix:create to build and sign your Flutter app
# - Creates a new release and uploads the generated .msix file to it
on:
push:
tags: "*"
jobs:
build_android:
name: Build Android APK
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: '17'
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
cache: true
cache-key: "flutter-ubuntu" # we don't need *the* most recent build
- name: Build APK
run: flutter build apk
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: dashboard_android
path: build/app/outputs/apk/release/app-release.apk
# End of build_android
build_windows:
name: Build Windows MSIX
runs-on: windows-2025
env:
windows_certificate: ${{ secrets.WINDOWS_CERTIFICATE }}
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Load certificate
run: |
echo "${{ env.windows_certificate }}" > windows_certificate_decoded.txt
openssl enc -base64 -d -in windows_certificate_decoded.txt -out windows_certificate.pfx
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
cache: true
cache-key: "flutter-windows" # we don't need *the* most recent build
channel: stable
- name: Flutter Doctor
run: flutter doctor
- name: Build MSIX
run: |
flutter pub get
dart run msix:create
- name: Upload MSIX
uses: actions/upload-artifact@v4
with:
name: dashboard_windows
path: build/windows/x64/runner/Release/dashboard.msix
# # End of build_windows
build_macos:
name: Build MacOS DMG
runs-on: macos-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
cache: true
cache-key: "flutter-macos" # we don't need *the* most recent build
- name: Check on Flutter
run: flutter doctor -v
- name: Install AppDmg tool
run: npm install --global appdmg
- name: Install dependencies
run: brew install automake libtool
- name: Build MacOS release
run: flutter build macos
- name: Package into DMG file
run: appdmg macos/installer_config.json dashboard_macos.dmg
- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: dashboard_macos
path: dashboard_macos.dmg
# End of build_windows
generate_release:
needs: [build_android, build_windows, build_macos]
runs-on: ubuntu-latest
steps:
- name: Download Android release
uses: actions/download-artifact@v4
with:
name: dashboard_android
- name: Download Windows release
uses: actions/download-artifact@v4
with:
name: dashboard_windows
- name: Download MacOS release
uses: actions/download-artifact@v4
with:
name: dashboard_macos
- name: Organize files
run: |
ls -al
mv app-release.apk dashboard_android.apk
mv dashboard.msix dashboard_windows.msix
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
dashboard_android.apk
dashboard_windows.msix
dashboard_macos.dmg
name: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
# # end of generate_release