4
4
push :
5
5
branches :
6
6
- release
7
+ paths :
8
+ - " pubspec.yaml"
7
9
8
10
jobs :
9
11
changelog :
10
12
name : 📃 Create changelog
11
13
runs-on : ubuntu-latest
12
- timeout-minutes : 5
14
+ timeout-minutes : 3
13
15
outputs :
14
16
changelog : ${{ steps.build_changelog.outputs.changelog }}
15
17
steps :
16
18
- name : Checks-out repository
17
19
uses : actions/checkout@v3
18
20
19
- - name : Build Changelog
21
+ - name : Create changelog
20
22
id : build_changelog
21
23
uses : mikepenz/release-changelog-builder-action@v3.3.1
22
24
env :
23
25
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
26
with :
25
27
configuration : " .github/workflows/actions_settings/changelog_config.json"
26
28
27
- build :
28
- name : 🏗️ Build Artifacts and Release
29
+ build-android-linux :
30
+ name : 🤖 Build Android and Linux apps
29
31
runs-on : ubuntu-latest
30
- timeout-minutes : 15
32
+ timeout-minutes : 25
31
33
steps :
32
34
- name : Checks-out repository
33
35
uses : actions/checkout@v3
@@ -46,52 +48,184 @@ jobs:
46
48
uses : actions/setup-java@v3
47
49
with :
48
50
distribution : " zulu"
49
- java-version : " 17"
51
+ java-version : " 18"
52
+
53
+ - name : Update Linux dependencies
54
+ run : sudo apt-get update -y
55
+
56
+ - name : Install new Linux dependencies
57
+ run : sudo apt-get --assume-yes --fix-missing install libgles2-mesa-dev clang cmake unzip curl ninja-build pkg-config libgtk-3-dev liblzma-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsecret-1-dev libjsoncpp-dev libsecret-1-0 libjsoncpp1
50
58
51
59
- name : Install Flutter
52
60
uses : subosito/flutter-action@v2.7.1
53
61
with :
54
62
cache : true
55
63
56
- - name : Decode android/key.properties
64
+ - name : Enable Linux
65
+ run : flutter config --enable-linux-desktop
66
+
67
+ - name : Install app dependencies
68
+ run : flutter pub get
69
+
70
+ - name : Build Linux app
71
+ run : flutter build linux --release
72
+
73
+ - name : Compress Linux app
74
+ uses : papeloto/action-zip@v1
75
+ with :
76
+ files : ./build/linux/x64/release/bundle/
77
+ dest : ./colors-ai-linux.zip
78
+
79
+ - name : Decode key.properties
57
80
run : echo "${{ secrets.KEY_PROPERTIES_BASE64 }}" | base64 --decode > android/key.properties
58
81
59
- - name : Decode android/app/ key.jks
82
+ - name : Decode key.jks
60
83
run : echo "${{ secrets.KEYSTORE_JKS_BASE64 }}" | base64 --decode > android/app/key.jks
61
84
62
- - name : Pub Get Packages
63
- run : flutter pub get
64
-
65
85
- name : Build Android app
66
86
run : flutter build appbundle --release && flutter build apk --release
67
87
88
+ - name : Rename APK
89
+ run : mv ./build/app/outputs/flutter-apk/app-release.apk ./build/app/outputs/flutter-apk/colors-ai-android.apk
90
+
68
91
- name : Create Github Release
69
92
uses : ncipollo/release-action@v1
70
93
with :
71
- artifacts : " build/app/outputs/bundle/release/app-release.aab,build/app/outputs/flutter-apk/app-release.apk"
94
+ artifacts : " build/app/outputs/flutter-apk/colors-ai-android.apk,colors-ai-linux.zip"
95
+ body : " ${{ github.event.head_commit.message }}"
72
96
token : ${{ secrets.GH_TOKEN }}
73
97
tag : " ${{env.RELEASE_TAG}}"
74
- body : " ${{ github.event.head_commit.message }} "
98
+ allowUpdates : true
75
99
76
100
- name : Save AAB to Artifacts
77
101
uses : actions/upload-artifact@v3
78
102
with :
79
103
name : APPBUNDLE
80
104
path : build/app/outputs/bundle/release/app-release.aab
81
105
82
- - name : Save APK to Artifacts
106
+ build-windows :
107
+ runs-on : windows-latest
108
+ needs : build-android-linux
109
+ name : 🖥️ Build Windows app
110
+ timeout-minutes : 15
111
+ steps :
112
+ - name : Checks-out repository
113
+ uses : actions/checkout@v3
114
+ with :
115
+ fetch-depth : 0
116
+
117
+ - name : Get latest release tag
118
+ id : previoustag
119
+ uses : WyriHaximus/github-action-get-previous-tag@v1
120
+
121
+ - name : Install Flutter
122
+ uses : subosito/flutter-action@v2.7.1
123
+ with :
124
+ cache : true
125
+
126
+ - name : Enable Windows
127
+ run : flutter config --enable-windows-desktop
128
+
129
+ - name : Install app dependencies
130
+ run : flutter pub get
131
+
132
+ - name : Build Windows app
133
+ run : flutter build windows --release
134
+
135
+ - name : Create MSIX package
136
+ run : flutter pub run msix:create
137
+
138
+ - name : Save MSIX to Artifacts
83
139
uses : actions/upload-artifact@v3
84
140
with :
85
- name : APK
86
- path : build/app/outputs/flutter-apk/app-release.apk
141
+ name : windows-release-build
142
+ path : build\windows\runner\Release\colors_ai.msix
143
+ retention-days : 1
144
+
145
+ - name : Copy VC redistributables
146
+ run : |
147
+ Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') .
148
+ Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') .
149
+ Copy-Item (vswhere -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140_1.dll') .
150
+ working-directory : ./build/windows/runner/Release
87
151
88
- release_google_play :
89
- name : 🏭 Release Artifacts to Google Play Store
90
- needs : [build, changelog]
152
+ - name : Compress Windows app
153
+ uses : papeloto/action-zip@v1
154
+ with :
155
+ files : ./build/windows/runner/Release/
156
+ dest : ./colors-ai-windows.zip
157
+
158
+ - uses : djnicholson/release-action@v2.11
159
+ with :
160
+ token : ${{ secrets.GH_TOKEN }}
161
+ tag-name : " ${{ steps.previoustag.outputs.tag }}"
162
+ asset-name : " colors-ai-windows.zip"
163
+ file : " colors-ai-windows.zip"
164
+
165
+ build-apple :
166
+ name : 🍏 Build macOS and iOS apps
167
+ needs : build-android-linux
168
+ runs-on : macos-latest
169
+ steps :
170
+ - name : Checks-out repository
171
+ uses : actions/checkout@v3
172
+ with :
173
+ fetch-depth : 0
174
+
175
+ - name : Get latest release tag
176
+ id : previoustag
177
+ uses : WyriHaximus/github-action-get-previous-tag@v1
178
+
179
+ - name : Install Flutter
180
+ uses : subosito/flutter-action@v2.7.1
181
+ with :
182
+ cache : true
183
+
184
+ - name : Enable macOS
185
+ run : flutter config --enable-macos-desktop
186
+
187
+ - name : Install app dependencies
188
+ run : flutter pub get
189
+
190
+ - name : Build iOS app
191
+ run : flutter build ios --release --no-codesign
192
+
193
+ - name : Compress iOS app
194
+ run : |
195
+ mkdir -p colors-ai
196
+ mv ./build/ios/iphoneos/Runner.app colors-ai
197
+ zip -r -y colors-ai.zip colors-ai/Runner.app
198
+ mv colors-ai.zip colors-ai-ios.ipa
199
+
200
+ - uses : djnicholson/release-action@v2.11
201
+ with :
202
+ token : ${{ secrets.GH_TOKEN }}
203
+ tag-name : " ${{ steps.previoustag.outputs.tag }}"
204
+ asset-name : " colors-ai-ios.ipa"
205
+ file : " colors-ai-ios.ipa"
206
+
207
+ - name : Build macOS app
208
+ run : flutter build macos
209
+
210
+ - name : Compress macOS app
211
+ run : zip -r colors-ai-macos.zip build/macos/Build/Products/Debug
212
+
213
+ - uses : djnicholson/release-action@v2.11
214
+ with :
215
+ token : ${{ secrets.GH_TOKEN }}
216
+ tag-name : " ${{ steps.previoustag.outputs.tag }}"
217
+ asset-name : " colors-ai-macos.zip"
218
+ file : " colors-ai-macos.zip"
219
+
220
+ publish-on-google-play :
221
+ name : 🏬 Publish app in Google Play Store
222
+ needs : [build-android-linux, changelog]
91
223
runs-on : ubuntu-latest
92
224
timeout-minutes : 10
93
225
steps :
94
- - uses : actions/checkout@v3
226
+ - name : Checks-out repository
227
+ uses : actions/checkout@v3
228
+
95
229
- name : Get AAB from Artifacts
96
230
uses : actions/download-artifact@v3
97
231
with :
@@ -112,3 +246,24 @@ jobs:
112
246
whatsNewDirectory : whatsnew
113
247
track : production
114
248
status : draft
249
+
250
+ publish-on-windows-store :
251
+ needs : build-windows
252
+ runs-on : ubuntu-latest
253
+ name : 🏪 Publish app in Microsoft Store
254
+ timeout-minutes : 15
255
+ steps :
256
+ - uses : actions/download-artifact@v3
257
+ name : Download Release
258
+ with :
259
+ name : windows-release-build
260
+ path : " ${{ github.workspace }}/release"
261
+
262
+ - uses : isaacrlevin/windows-store-action@1.0
263
+ name : Publish to Store
264
+ with :
265
+ tenant-id : ${{ secrets.AZURE_AD_TENANT_ID }}
266
+ client-id : ${{ secrets.AZURE_AD_APPLICATION_CLIENT_ID }}
267
+ client-secret : ${{ secrets.AZURE_AD_APPLICATION_SECRET }}
268
+ app-id : ${{ secrets.WINDOWS_STORE_APP_ID }}
269
+ package-path : " ${{ github.workspace }}/release"
0 commit comments