Skip to content

Build and Release Flutter APK #12

Build and Release Flutter APK

Build and Release Flutter APK #12

name: Build and Release Flutter APK
on:
workflow_dispatch:
push:
branches:
- compile # 监听 compile 分支
jobs:
build:
name: Build Flutter APK
runs-on: ubuntu-latest
steps:
- name: 拉取 main 分支代码(即使是 compile 触发)
uses: actions/checkout@v4
with:
ref: main # 👈 指定拉取 main 分支
- 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: 上传 APK 作为 artifact
uses: actions/upload-artifact@v4
with:
name: flutter-apk
path: build/app/outputs/flutter-apk/*.apk