-
Notifications
You must be signed in to change notification settings - Fork 386
243 lines (220 loc) · 7.53 KB
/
publish_app_dev.yaml
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
name: app-build-action-dev
on:
workflow_dispatch:
push:
branches:
- 'dev'
jobs:
# 打包Android、iOS、Mac
build-mac-ios-android:
runs-on: macos-latest
permissions:
contents: write
steps:
# 签出代码
- uses: actions/checkout@v4
with:
ref: dev
# APK签名设置
- name: Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: keystore.jks
encodedString: ${{ secrets.KEYSTORE_BASE64 }}
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > simple_live_app/android/key.properties
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> simple_live_app/android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> simple_live_app/android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> simple_live_app/android/key.properties
# 设置JAVA环境
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: "17"
cache: "gradle"
# 设置Flutter
- name: Flutter action
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.x'
cache: true
# 打开MAC Desktop支持
- name: Enable Flutter Desktop
run: flutter config --enable-macos-desktop
# 更新Flutter的packages
- name: Restore packages
run: |
cd simple_live_app
flutter pub get
# 安装appdmg npm install -g appdmg
- name: Install appdmg
run: npm install -g appdmg
# 设置flutter_distributor环境
- name: Install flutter_distributor
run: dart pub global activate flutter_distributor
# 打包APK
- name: Build APK
run: |
cd simple_live_app
flutter build apk --release --split-per-abi
#上传Artifacts
- name: Upload APK to Artifacts
uses: actions/upload-artifact@v4
with:
name: android
path: |
simple_live_app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
simple_live_app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
simple_live_app/build/app/outputs/flutter-apk/app-x86_64-release.apk
# TV APK签名设置
- name: Download Android TV keystore
id: android_tv_keystore
uses: timheuer/[email protected]
with:
fileName: keystore_tv.jks
encodedString: ${{ secrets.TV_KEYSTORE_BASE64 }}
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_tv_keystore.outputs.filePath }}" > simple_live_tv_app/android/key.properties
echo "storePassword=${{ secrets.TV_STORE_PASSWORD }}" >> simple_live_tv_app/android/key.properties
echo "keyPassword=${{ secrets.TV_KEY_PASSWORD }}" >> simple_live_tv_app/android/key.properties
echo "keyAlias=${{ secrets.TV_KEY_ALIAS }}" >> simple_live_tv_app/android/key.properties
#打包 Android TV APK
- name: Build TV APK
run: |
cd simple_live_tv_app
flutter build apk --release --split-per-abi
#上传TV APK至Artifacts
- name: Upload TV APK to Artifacts
uses: actions/upload-artifact@v4
with:
name: android_tv
path: |
simple_live_tv_app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
simple_live_tv_app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
simple_live_tv_app/build/app/outputs/flutter-apk/app-x86_64-release.apk
#打包iOS
- name: Build IPA
run: |
cd simple_live_app
flutter build ios --release --no-codesign
#创建未签名ipa
- name: Create IPA
run: |
cd simple_live_app
mkdir build/ios/iphoneos/Payload
cp -R build/ios/iphoneos/Runner.app build/ios/iphoneos/Payload/Runner.app
cd build/ios/iphoneos/
zip -q -r ios_no_sign.ipa Payload
cd ../../..
# 上传IPA至Artifacts
- name: Upload IPA to Artifacts
uses: actions/upload-artifact@v4
with:
name: ios
path: |
simple_live_app/build/ios/iphoneos/ios_no_sign.ipa
# 打包MAC
- name: Build MacOS
run: |
cd simple_live_app
flutter_distributor package --platform macos --targets dmg,zip --skip-clean
# 上传MAC至Artifacts
- name: Upload MacOS to Artifacts
uses: actions/upload-artifact@v4
with:
name: mac
path: |
simple_live_app/build/dist/*/*.dmg
simple_live_app/build/dist/*/*.zip
#完成
- run: echo "🍏 This job's status is ${{ job.status }}."
# 打包Linux
build-linux:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
# 签出代码
- uses: actions/checkout@v4
with:
ref: dev
# 设置Flutter环境
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.x"
cache: true
# 安装依赖
- name: Update apt-get
run: sudo apt-get update
- name: Install Dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev mpv
# 打开Linux Desktop支持
- name: Enable Flutter Desktop
run: flutter config --enable-linux-desktop
# 更新Flutter的packages
- name: Restore Packages
run: |
cd simple_live_app
flutter pub get
# 设置flutter_distributor环境
- name: Install flutter_distributor
run: dart pub global activate flutter_distributor
# build Linux ZIP\DMG
- name: Build Linux
run: |
cd simple_live_app
flutter_distributor package --platform linux --targets deb,zip --skip-clean
# 上传Linux包至Artifacts
- name: Upload Linux APP to Artifacts
uses: actions/upload-artifact@v4
with:
name: linux
path: |
simple_live_app/build/dist/*/*.deb
simple_live_app/build/dist/*/*.zip
#完成
- run: echo "🍏 Linux job's status is ${{ job.status }}."
# 打包Windows
build-windows:
runs-on: windows-latest
permissions:
contents: write
steps:
# 签出代码
- uses: actions/checkout@v4
with:
ref: dev
# 设置Flutter环境
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.x"
cache: true
- name: Enable Flutter Desktop
run: flutter config --enable-windows-desktop
- name: Restore Packages
run: |
cd simple_live_app
flutter pub get
# 设置flutter_distributor环境
- name: Install flutter_distributor
run: dart pub global activate flutter_distributor
# build Windows ZIP\MSIX
- name: Build Windows
run: |
cd simple_live_app
flutter_distributor package --platform windows --targets msix,zip --skip-clean
# 上传Windows至Artifacts
- name: Upload Windows APP to Artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: |
simple_live_app/build/dist/*/*.msix
simple_live_app/build/dist/*/*.zip
#完成
- run: echo "🍏 Windows job's status is ${{ job.status }}."