Build and Release Flutter APK #81
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release Flutter APK | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Flutter APK | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - name: 拉取 main 分支代码 | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: 设置 Flutter 环境 | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.32.2' | |
| - name: 获取依赖 | |
| run: flutter pub get | |
| - name: 构建 APK (按 ABI 分割) | |
| run: flutter build apk --release --split-per-abi --no-tree-shake-icons | |
| - name: 上传 arm64-v8a APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: flutter-app-arm64-v8a | |
| path: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
| retention-days: 5 | |
| - name: 上传 armeabi-v7a APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: flutter-app-armeabi-v7a | |
| path: build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
| retention-days: 5 | |
| - name: 上传 x86_64 APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: flutter-app-x86_64 | |
| path: build/app/outputs/flutter-apk/app-x86_64-release.apk | |
| retention-days: 5 |