diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml new file mode 100644 index 00000000..3c854cac --- /dev/null +++ b/.github/workflows/flutter.yml @@ -0,0 +1,31 @@ +name: Flutter Build + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest # 在Ubuntu环境中构建 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: 'stable' + + - name: Install dependencies + run: flutter pub get + + - name: Build APK + run: flutter build apk --release + + - name: Upload APK + uses: actions/upload-artifact@v2 + with: + name: app-release + path: build/app/outputs/flutter-apk/app-release.apk