-
Notifications
You must be signed in to change notification settings - Fork 109
323 lines (271 loc) · 11.8 KB
/
build_all.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
name: Build All Packages
on:
workflow_dispatch:
jobs:
get_version:
runs-on: ubuntu-latest
outputs:
app_version: ${{ steps.fetch_version.outputs.app_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Fetch Version
id: fetch_version
run: |
sudo snap install yq
app_version=$(yq eval '.version' pubspec.yaml)
echo "app_version=$app_version" >> $GITHUB_OUTPUT
build_android_apks:
name: Build and Push Android APKs
needs: get_version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set up signing files
env:
APK_SIGN_PWD: "${{ secrets.APK_SIGN_PWD }}"
APK_SIGN_ALIAS: "${{ secrets.APK_SIGN_ALIAS }}"
APK_SIGN_JKS: "${{ secrets.APK_SIGN_JKS }}"
run: |
chmod a+x tools/generate_jks_linux_amd64
tools/generate_jks_linux_amd64
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
chmod a+x tools/key_replace_linux_amd64
tools/key_replace_linux_amd64
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Build APK
run: flutter build apk --release
- name: Build APK (split per ABI)
run: flutter build apk --release --split-per-abi
- name: Rename APKs
run: |
mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_unknown.apk
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_armeabi-v7a.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_arm64-v8a.apk
mv build/app/outputs/flutter-apk/app-x86_64-release.apk build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_x86_64.apk
- name: Upload APK (unknown)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_unknown_${{ needs.get_version.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_unknown.apk
compression-level: 9
- name: Upload APK (armeabi-v7a)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_armeabi-v7a_${{ needs.get_version.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_armeabi-v7a.apk
compression-level: 9
- name: Upload APK (arm64-v8a)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_arm64-v8a_${{ needs.get_version.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_arm64-v8a.apk
compression-level: 9
- name: Upload APK (x86_64)
uses: actions/upload-artifact@v4
with:
name: AppRhyme_android_x86_64_${{ needs.get_version.outputs.app_version }}
path: build/app/outputs/flutter-apk/AppRhyme_android_${{ needs.get_version.outputs.app_version }}_x86_64.apk
compression-level: 9
build_ios_ipa:
name: Build and Push Ios Ipa
needs: get_version
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
chmod a+x tools/key_replace_macox_unknown
tools/key_replace_macox_unknown
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Flutter Build Ios
run: |-
flutter build ios --release --no-codesign --verbose
- name: Unbitcode
run: |-
chmod 777 tools/unbitcode.sh
sh tools/unbitcode.sh
- name: Create Ipa
run: |-
mkdir -p Payload
mv ./build/ios/iphoneos/Runner.app Payload
zip -r -y AppRhyme_ios_unknown_${{ needs.get_version.outputs.app_version }}.ipa Payload/Runner.app
- name: Upload AppImage Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_ios_unknown_${{ needs.get_version.outputs.app_version }}_ipa
path: AppRhyme_ios_unknown_${{ needs.get_version.outputs.app_version }}.ipa
compression-level: 9
build_windows_setup_exe:
name: Build and Push Windows Packages
needs: get_version
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
tools/key_replace_windows_amd64
shell: pwsh
- name: Setup Inno Setup 6
run: |-
tools/innosetup-6.3.3.exe /VERYSILENT
shell: pwsh
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Distribute Packages
run: |
dart pub global activate --source git https://github.com/canxin121/flutter_distributor --git-ref temp --git-path packages/flutter_distributor
flutter_distributor package --platform windows --targets exe
shell: pwsh
- name: Rename Packages
run: |
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.exe ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.exe
- name: Upload exe Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64_exe
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_windows_${{ needs.get_version.outputs.app_version }}_x86-64.exe
compression-level: 9
build_linux_packages:
name: Build and Push Linux Packages
needs: get_version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
chmod a+x tools/key_replace_linux_amd64
tools/key_replace_linux_amd64
- name: Setup Dependencies
run: |
sudo apt-get update -y
sudo apt install -y locate rpm patchelf libwebkit2gtk-4.1-dev
sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libasound2-dev
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool
sudo mv appimagetool /usr/local/bin/
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Distribute Packages
run: |
dart pub global activate --source git https://github.com/canxin121/flutter_distributor --git-ref temp --git-path packages/flutter_distributor
flutter_distributor package --platform linux --targets rpm,deb,appimage
- name: Rename Packages
run: |
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.deb ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86-64.deb
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.rpm ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86_64.rpm
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.AppImage ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86-64.AppImage
- name: Upload deb Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86-64_deb
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86-64.deb
compression-level: 9
- name: Upload rpm Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86-64_rpm
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86_64.rpm
compression-level: 9
- name: Upload AppImage Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86-64_AppImage
path: dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_linux_${{ needs.get_version.outputs.app_version }}_x86-64.AppImage
compression-level: 9
build_macos_package:
name: Build and Push Macos Packages
needs: get_version
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Replace key
env:
SOME_SECRET_KEY: ${{ secrets.SOME_SECRET_KEY }}
SOME_REPLACE_KEY: ${{ secrets.SOME_REPLACE_KEY }}
SOME_REPLACE_FILE: ${{ secrets.SOME_REPLACE_FILE }}
run: |
chmod a+x tools/key_replace_macox_unknown
tools/key_replace_macox_unknown
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Setup Depencies
run: |-
npm install -g appdmg
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Package Dmg
run: |-
dart pub global activate --source git https://github.com/canxin121/flutter_distributor --git-ref temp --git-path packages/flutter_distributor
flutter_distributor package --platform macos --target dmg
- name: Rename Dmg
run: |
mv ./dist/${{ needs.get_version.outputs.app_version }}/*.dmg ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_macos_unknown_${{ needs.get_version.outputs.app_version }}.dmg
- name: Upload AppImage Package
uses: actions/upload-artifact@v4
with:
name: AppRhyme_macos_unknown_${{ needs.get_version.outputs.app_version }}_dmg
path: ./dist/${{ needs.get_version.outputs.app_version }}/AppRhyme_macos_unknown_${{ needs.get_version.outputs.app_version }}.dmg
compression-level: 9