-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (33 loc) · 1.06 KB
/
main.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
# 根据上传的tag,自动编译并发布Release至Github
name: 发布Github Release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
publish-release-apk:
runs-on: ubuntu-latest
steps:
- name: 1.检出代码
uses: actions/checkout@v2
- name: 2.准备Java环境
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: 3.准备Flutter环境
uses: subosito/flutter-action@v2.2.0
with:
flutter-version: '2.8.1'
channel: 'stable'
- name: 4.解决依赖
run: flutter pub get
- name: 5.编译apk
run: flutter build apk --target-platform=android-arm,android-arm64 --split-per-abi --obfuscate --split-debug-info=tmp/
- name: 6.发布至Github-Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: "自动发布"
artifacts: "build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk,build/app/outputs/flutter-apk/app-arm64-v8a-release.apk"