Build and Release Flutter APK #13
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 | |
| 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: 上传 APK 到 Release (tag:test) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: test | |
| name: Test Release | |
| generate_release_notes: true | |
| overwrite: true | |
| files: build/app/outputs/flutter-apk/*.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |