update #1
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: Flutter CI | |
on: | |
push: | |
branches: | |
- main # 根据你的默认分支修改 | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "11" | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.24.3" # 更新为你的 Flutter 版本 | |
- name: Install Dependencies | |
run: flutter pub get | |
- name: Run Tests | |
run: flutter test | |
- name: Build APK | |
run: flutter build apk --release | |
- name: Upload Release APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: app-release.apk | |
path: build/app/outputs/flutter-apk/app-release.apk |