Skip to content

Commit 4e05db4

Browse files
committed
增加TV Dev打包
1 parent 352de94 commit 4e05db4

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: app-build-action
2+
#推送Tag时触发
3+
on:
4+
push:
5+
branches:
6+
- "tv_dev"
7+
jobs:
8+
build-tv:
9+
runs-on: macos-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
#签出代码
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: master
17+
18+
#APK签名设置
19+
- name: Download Android keystore
20+
id: android_tv_keystore
21+
uses: timheuer/base64-to-file@v1.2
22+
with:
23+
fileName: keystore.jks
24+
encodedString: ${{ secrets.TV_KEYSTORE_BASE64 }}
25+
- name: Create key.properties
26+
run: |
27+
echo "storeFile=${{ steps.android_tv_keystore.outputs.filePath }}" > simple_live_tv_app/android/key.properties
28+
echo "storePassword=${{ secrets.TV_STORE_PASSWORD }}" >> simple_live_tv_app/android/key.properties
29+
echo "keyPassword=${{ secrets.TV_KEY_PASSWORD }}" >> simple_live_tv_app/android/key.properties
30+
echo "keyAlias=${{ secrets.TV_KEY_ALIAS }}" >> simple_live_tv_app/android/key.properties
31+
32+
# 设置JAVA环境
33+
- uses: actions/setup-java@v4
34+
with:
35+
distribution: "zulu"
36+
java-version: "17"
37+
cache: "gradle"
38+
39+
#设置Flutter
40+
- name: Flutter action
41+
uses: subosito/flutter-action@v2
42+
with:
43+
flutter-version: "3.35.x"
44+
cache: true
45+
46+
#更新Flutter的packages
47+
- name: Restore packages
48+
run: |
49+
cd simple_live_tv_app
50+
flutter pub get
51+
52+
#打包APK
53+
- name: Build APK
54+
run: |
55+
cd simple_live_tv_app
56+
flutter build apk --release --split-per-abi
57+
58+
#上传APK至Artifacts
59+
- name: Upload APK to Artifacts
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: android_tv
63+
path: |
64+
simple_live_tv_app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
65+
simple_live_tv_app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
66+
simple_live_tv_app/build/app/outputs/flutter-apk/app-x86_64-release.apk
67+
#完成
68+
- run: echo "🍏 This job's status is ${{ job.status }}."

0 commit comments

Comments
 (0)