-
Notifications
You must be signed in to change notification settings - Fork 6
43 lines (34 loc) · 1.11 KB
/
build_and_release.yml
File metadata and controls
43 lines (34 loc) · 1.11 KB
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
name: Build and Release Flutter APK
on:
workflow_dispatch:
jobs:
build:
name: Build Flutter APK
runs-on: ubuntu-latest
steps:
- name: 拉取项目代码
uses: actions/checkout@v4
- name: 设置 Flutter 环境
uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.2' # 根据你的 Flutter 版本修改
- name: 获取依赖
run: flutter pub get
- name: 构建 APK
run: flutter build apk --split-per-abi --no-tree-shake-icons
- name: 创建 Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: apk-release-${{ github.run_number }}
name: Release ${{ github.run_number }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 上传所有 APK 到 Release
uses: softprops/action-gh-release@v2
with:
tag_name: apk-release-${{ github.run_number }}
files: build/app/outputs/flutter-apk/*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}