-
Notifications
You must be signed in to change notification settings - Fork 3
422 lines (379 loc) · 14.7 KB
/
build.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
name: Build Flutter Client
on:
push:
branches:
- main
release:
types:
- created
pull_request:
workflow_dispatch:
jobs:
build_android:
name: Bluecherry Client Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
# We need to enforce java 17 because newer Flutter packages are
# requiring this Java Version.
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
check-latest: true
- uses: subosito/[email protected]
with:
channel: "stable"
# cache: true
# TODO: Signing Android application.
# - name: Create Key Store
# id: create_key_store
# uses: timheuer/base64-to-file@v1
# with:
# fileName: "keystore.pfx"
# encodedString: ${{ secrets.KEY_STORE }}
# - name: Create Key Properties
# id: create_key_properties
# uses: timheuer/base64-to-file@v1
# with:
# fileName: "key.properties"
# encodedString: ${{ secrets.KEY_PROPERTIES }}
# - run: cp "${{ steps.create_key_store.outputs.filePath }}" android/app/keystore.jks
# - run: cp "${{ steps.create_key_properties.outputs.filePath }}" android/key.properties
- run: flutter gen-l10n
- run: flutter pub get
- run: flutter build apk --verbose --split-per-abi
- run: flutter build appbundle --verbose
- run: cp build/app/outputs/flutter-apk/app-arm64-v8a-release.apk bluecherry-android-arm64-v8a-release.apk
- run: cp build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk bluecherry-android-armeabi-v7a-release.apk
- run: cp build/app/outputs/flutter-apk/app-x86_64-release.apk bluecherry-android-x86_64-release.apk
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: ${{ github.event_name == 'push' }}
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: true
body: ""
tag_name: "bleeding_edge"
files: |
bluecherry-android-arm64-v8a-release.apk
bluecherry-android-armeabi-v7a-release.apk
bluecherry-android-x86_64-release.apk
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
bluecherry-android-arm64-v8a-release.apk
bluecherry-android-armeabi-v7a-release.apk
bluecherry-android-x86_64-release.apk
token: ${{ secrets.GITHUB_TOKEN }}
build_iOS:
name: Bluecherry Client iOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- uses: subosito/[email protected]
with:
channel: "stable"
architecture: x64
# cache: true
- run: flutter gen-l10n
- run: flutter pub get
- run: flutter build ios --verbose --no-codesign
- run: flutter build ipa --verbose --no-codesign
# App should be published with TestFlight
# - name: Release
# # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
# if: ${{ github.event_name == 'push' }}
# uses: softprops/action-gh-release@v1
# with:
# draft: true
# prerelease: false
# body: ""
# tag_name: "bleeding_edge"
# files: |
# .exe
# token: ${{ secrets.GITHUB_TOKEN }}
#- name: Release
# # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
# if: startsWith(github.ref, 'refs/tags/')
# uses: softprops/action-gh-release@v1
# with:
# files: |
# .exe
# token: ${{ secrets.GITHUB_TOKEN }}
build_macOS:
name: Bluecherry Client macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- uses: subosito/[email protected]
with:
channel: "stable"
architecture: x64
# cache: true
- name: Update Pods
working-directory: ./macos/
run: |
pod repo update
pod cache clean mdk
rm -rf /Pods
rm -rf /Podfile.lock
- run: flutter gen-l10n
- run: flutter pub get
- run: flutter build macos --verbose
- run: 7z a bluecherry-macos.7z build/macos/Build/Products/Release/unity.app
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: ${{ github.event_name == 'push' }}
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: false
body: ""
tag_name: "bleeding_edge"
files: |
bluecherry-macos.7z
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
bluecherry-macos.7z
token: ${{ secrets.GITHUB_TOKEN }}
build_windows:
name: Bluecherry Client Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- uses: subosito/[email protected]
with:
channel: "stable"
# cache: true
- run: git config --system core.longpaths true
- run: flutter gen-l10n
- run: flutter pub get
- run: flutter build windows --verbose
- name: Copy VSCode redistribution libs over
shell: powershell
working-directory: .\build\windows\x64\runner\Release
# Copy the latest vscode redistribution .dll files into the folder as per
# https://docs.flutter.dev/platform-integration/windows/building#distributing-windows-apps
# to fix crash issues like:
# https://github.com/media-kit/media-kit/issues/842
run: |
Copy-Item (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140.dll') -Force .
Copy-Item (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140_1.dll') -Force .
Copy-Item (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find 'VC\Redist\MSVC\*\x64\*\msvcp140_2.dll') -Force .
Copy-Item (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140.dll') -Force .
Copy-Item (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find 'VC\Redist\MSVC\*\x64\*\vcruntime140_1.dll') -Force .
- name: Building the installer
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "installer/windows-installer.iss"
shell: cmd
- run: cp installer\Output\bluecherry-windows-setup.exe bluecherry-windows-setup.exe
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: ${{ github.event_name == 'push' }}
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: false
body: ""
tag_name: "bleeding_edge"
files: |
bluecherry-windows-setup.exe
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
bluecherry-windows-setup.exe
token: ${{ secrets.GITHUB_TOKEN }}
build_linux:
name: Bluecherry Client Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Install dependencies
# https://docs.flutter.dev/platform-integration/linux/building#prepare-linux-apps-for-distribution
# https://pub.dev/packages/flutter_secure_storage#configure-linux-version
run: |
sudo apt-get update -y
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev mpv libmpv-dev dpkg-dev p7zip-full p7zip-rar libsecret-1-dev libjsoncpp-dev
- name: Install Flutter
uses: subosito/[email protected]
with:
channel: "stable"
# cache: true
- name: Initiate Flutter
run: |
flutter gen-l10n
flutter pub get
- name: Build Flutter for RPM
run: |
flutter build linux --verbose --dart-define-from-file=linux/env/rpm.json
- name: Build RPM Package
continue-on-error: true
run: |
mkdir -p linux/debian/usr/bin
cp -fr build/linux/x64/release/bundle linux/debian/usr/share/bluecherry_client
ln -sr linux/debian/usr/share/bluecherry_client/bluecherry_client linux/debian/usr/bin/bluecherry_client
sed -i "s:cp -rf :cp -rf $(pwd)/:" linux/rpm/bluecherry.spec
cd linux/debian
sed -i "s:FILES_HERE:$(find usr \( -type l -o -type f \) -follow -print | awk '{printf "/%s\\n", $0}'):" ../rpm/bluecherry.spec
cd ../../
rpmbuild -bb linux/rpm/bluecherry.spec -D "_topdir $(pwd)/rpmbuild"
cp rpmbuild/RPMS/x86_64/*.rpm bluecherry-linux-x86_64.rpm
- name: Build Flutter for DEB
run: |
flutter clean
flutter gen-l10n
flutter pub get
flutter build linux --verbose --dart-define-from-file=linux/env/deb.json
rm -r linux/debian/usr/bin
mkdir -p linux/debian/usr/bin
cp -fr build/linux/x64/release/bundle linux/debian/usr/share/bluecherry_client
ln -sr linux/debian/usr/share/bluecherry_client/bluecherry_client linux/debian/usr/bin/bluecherry_client
- name: Build DEB Package
continue-on-error: true
run: |
dpkg-deb --build --root-owner-group linux/debian
cp linux/*.deb bluecherry-linux-x86_64.deb
- name: Build Flutter for Tarball
run: |
flutter clean
flutter gen-l10n
flutter pub get
flutter build linux --verbose --dart-define-from-file=linux/env/tar.gz.json
rm -r linux/debian/usr/bin
mkdir -p linux/debian/usr/bin
cp -fr build/linux/x64/release/bundle linux/debian/usr/share/bluecherry_client
ln -sr linux/debian/usr/share/bluecherry_client/bluecherry_client linux/debian/usr/bin/bluecherry_client
- name: Build Tarball
continue-on-error: true
run: |
mkdir -p AppDir/
cp -r linux/debian/usr AppDir/
ln -sr AppDir/usr/bin/bluecherry_client AppDir/bluecherry_client
tar czf bluecherry-linux-x86_64.tar.gz -C AppDir/ .
- name: Build Flutter for AppImage
run: |
rm -r AppDir/
mkdir -p AppDir/
flutter clean
flutter gen-l10n
flutter pub get
flutter build linux --verbose --dart-define-from-file=linux/env/appimage.json
- name: Build AppImage
continue-on-error: true
run: |
sudo pip3 install git+https://github.com/AppImageCrafters/appimage-builder.git
appimage-builder --skip-tests
cp Bluecherry-latest-x86_64.AppImage bluecherry-linux-x86_64.AppImage
#- name: Install Snapcraft
# continue-on-error: true
# uses: samuelmeuli/action-snapcraft@v3
#
#- name: Build Snapcraft
# run: |
# snapcraft
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: ${{ github.event_name == 'push' }}
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: true
body: ""
tag_name: "bleeding_edge"
files: |
bluecherry-linux-x86_64.AppImage
bluecherry-linux-x86_64.deb
bluecherry-linux-x86_64.tar.gz
bluecherry-linux-x86_64.rpm
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
bluecherry-linux-x86_64.AppImage
bluecherry-linux-x86_64.deb
bluecherry-linux-x86_64.tar.gz
bluecherry-linux-x86_64.rpm
token: ${{ secrets.GITHUB_TOKEN }}
build_pi:
name: Bluecherry Raspberry Pi
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Install Flutter
uses: subosito/[email protected]
with:
channel: "stable"
flutter-version: 3.27.0
cache: false
- name: Initiate Flutter
run: |
flutter gen-l10n
flutter pub get
flutter pub global activate flutterpi_tool
- name: Build
run: |
flutterpi_tool build --release --cpu=pi4
build_web:
name: Bluecherry Web
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Install Flutter
uses: subosito/[email protected]
with:
channel: "stable"
cache: false
- name: Initiate Flutter
run: |
flutter gen-l10n
flutter pub get
- name: Build
run: |
flutter build web --verbose --dart-define=FLUTTER_WEB_USE_SKIA=true --dart-define=FLUTTER_WEB_AUTO_DETECT=true