-
Notifications
You must be signed in to change notification settings - Fork 12
384 lines (326 loc) · 12.6 KB
/
release.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
name: release
on:
release:
types:
- created
workflow_dispatch:
env:
PROJECT_PATH: commet
jobs:
release-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Clone Olm
run: |
git clone https://gitlab.matrix.org/matrix-org/olm.git
cd ./olm
git checkout 7e0c8277032e40308987257b711b38af8d77cc69
- name: Build Olm
run: |
cd ./olm
cmake -DCMAKE_BUILD_TYPE=Release . -A x64 -Bbuild
cmake --build build --config Release
- name: Configure Flutter
run: flutter config --enable-windows-desktop
- name: Code Generation
run: |
cd .\commet
git config --global core.longpaths true
dart run scripts/codegen.dart
- name: Build Windows App
run: |
cd .\commet
dart run scripts/build_release.dart --platform windows --version_tag ${{ github.event.release.tag_name || 'v0.0.0' }} --git_hash ${{ github.sha }}
- name: Include libolm
run: |
dir
dir .\olm
dir .\commet
dir .\commet\build\windows
move .\olm\build\Release\olm.dll .\commet\build\windows\x64\runner\Release\libolm.dll
- name: Archive
run: tar -a -c -f commet-windows.zip -C .\commet\build\windows\x64\runner\ Release
- name: Upload to release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: .\commet-windows.zip
asset_name: commet-windows.zip
asset_content_type: application/zip
release-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 17
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg
- name: Code Generation
run: |
cd $PROJECT_PATH
dart run scripts/codegen.dart
- name: Setup Signatures
run: |
cd $PROJECT_PATH
dart run scripts/setup_android_release.dart --key_password ${{ secrets.ANDROID_KEY_PASSWORD }} --key_b64 ${{ secrets.ANDROID_KEY_STORE_B64 }}
- name: Build APK
run: |
cd $PROJECT_PATH
dart run scripts/build_release.dart --platform android --version_tag ${{ github.event.release.tag_name || 'v0.0.0' }} --git_hash ${{ github.sha }}
- name: Upload to release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: commet/build/app/outputs/flutter-apk/app-release.apk
asset_name: commet-android.apk
asset_content_type: application/vnd.android.package-archive
release-android-google-services:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 17
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg
- name: Code Generation
run: |
cd $PROJECT_PATH
git apply scripts/apply_google_services.patch
dart run scripts/codegen.dart
- name: Setup Signatures
run: |
cd $PROJECT_PATH
dart run scripts/setup_android_release.dart --key_password ${{ secrets.ANDROID_KEY_PASSWORD }} --key_b64 ${{ secrets.ANDROID_KEY_STORE_B64 }}
- name: Build APK
run: |
cd $PROJECT_PATH
dart run scripts/build_release.dart --platform android --version_tag ${{ github.event.release.tag_name || 'v0.0.0' }} --git_hash ${{ github.sha }} --enable_google_services true --build_detail google_services
- name: Upload to release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: commet/build/app/outputs/flutter-apk/app-release.apk
asset_name: commet-android-google-services.apk
asset_content_type: application/vnd.android.package-archive
release-linux-debian:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg libmimalloc-dev
- name: Code Generation
run: |
cd $PROJECT_PATH
dart run scripts/codegen.dart
- name: Build Linux
run: |
cd $PROJECT_PATH
dart run scripts/build_release.dart --platform linux --version_tag ${{ github.event.release.tag_name || 'v0.0.0' }} --git_hash ${{ github.sha }} --build_detail debian
- name: Create Package
run: |
mv $PROJECT_PATH/linux/debian/DEBIAN/control-${{ matrix.os }} $PROJECT_PATH/linux/debian/DEBIAN/control
cp -r $PROJECT_PATH/linux/debian ./commet-pkg
cp -r $PROJECT_PATH/build/linux/x64/release/bundle ./commet-pkg/usr/lib/chat.commet.commetapp
version=$(echo ${{ github.event.release.tag_name || 'v0.0.0' }} | grep -oP '[0-9]+([.][0-9]+)+')
echo $version
cd ./commet-pkg
sed -i "s/{{VERSION_TAG}}/$version/g" ./DEBIAN/control
dpkg-deb --build ./ commet-linux-x64.deb
- name: Upload to release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: commet-pkg/commet-linux-x64.deb
asset_name: commet-${{ matrix.os }}-x64.deb
asset_content_type: application/vnd.debian.binary-package
release-linux-flatpak:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg libmimalloc-dev flatpak-builder flatpak
- name: Code Generation
run: |
cd $PROJECT_PATH
dart run scripts/codegen.dart
- name: Build Linux
run: |
cd $PROJECT_PATH
dart run scripts/build_release.dart --platform linux --version_tag ${{ github.event.release.tag_name || 'v0.0.0' }} --git_hash ${{ github.sha }} --build_detail flatpak
- name: Create Flatpak
run: |
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install -y flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
mkdir -p commet/linux/flatpak/commet
cp -r $PROJECT_PATH/build/linux/x64/release/bundle $PROJECT_PATH/linux/flatpak/commet/bundle
version=$(echo ${{ github.event.release.tag_name || 'v0.0.0' }} | grep -oP '[0-9]+([.][0-9]+)+')
echo $version
cd $PROJECT_PATH/linux/flatpak
sed -i "s/{{VERSION_TAG}}/$version/g" ./chat.commet.commetapp.desktop
sed -i "s/{{VERSION_TAG}}/$version/g" ./chat.commet.commetapp.metainfo.xml
flatpak-builder --force-clean build-dir chat.commet.commetapp.yaml --repo=repo
flatpak build-bundle repo chat.commet.commetapp.flatpak chat.commet.commetapp
- name: Upload to release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: commet/linux/flatpak/chat.commet.commetapp.flatpak
asset_name: chat.commet.commetapp.flatpak
asset_content_type: application/octet-stream
release-linux-portable:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg libmimalloc-dev
- name: Code Generation
run: |
cd $PROJECT_PATH
dart run scripts/codegen.dart
- name: Build Linux
run: |
cd $PROJECT_PATH
dart run scripts/build_release.dart --platform linux --version_tag ${{ github.event.release.tag_name || 'v0.0.0' }} --git_hash ${{ github.sha }} --build_detail linux-x64
- name: Create archive
run: |
cd $PROJECT_PATH/build/linux/x64/release
tar -czf commet-linux-portable-x64.tar.gz bundle
- name: Upload to release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: commet/build/linux/x64/release/commet-linux-portable-x64.tar.gz
asset_name: commet-linux-portable-x64.tar.gz
asset_content_type: application/gzip
release-web:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg
- name: Code Generation
run: |
cd $PROJECT_PATH
dart run scripts/codegen.dart
- name: Include Olm
run: |
cd $PROJECT_PATH
cd assets/js
rm -r package
curl -L 'https://github.com/famedly/olm/releases/download/v2.0.0/olm.zip' > olm.zip
sha256sum -c <<< '644bbc7cdcf5931fb64c1b556a3672830ca2af6615caa814458785043895c6df olm.zip'
unzip olm.zip
rm olm.zip
mv javascript package
- name: Build Web
run: |
cd $PROJECT_PATH
dart run scripts/build_release.dart --platform web --version_tag ${{ github.event.release.tag_name || 'v0.0.0' }} --git_hash ${{ github.sha }}
- name: Create archive
run: |
cd $PROJECT_PATH/build
tar -czf commet-web.tar.gz web
- name: Upload to release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: commet/build/commet-web.tar.gz
asset_name: commet-web.tar.gz
asset_content_type: application/gzip