feat: add wechat login #9
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/CD | ||
|
Check failure on line 1 in .github/workflows/flutter_ci_cd.yml
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| jobs: | ||
| build-android: | ||
| name: Build Android APK | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' | ||
| - name: Set up Android SDK | ||
| uses: android-actions/setup-android@v3 | ||
| - name: Set up Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: stable | ||
| - name: Install dependencies | ||
| run: flutter pub get | ||
| - name: Analyze code | ||
| run: flutter analyze | ||
| - name: Run tests | ||
| run: flutter test | ||
| - name: Build APK | ||
| run: flutter build apk --release | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: android-apk | ||
| path: build/app/outputs/flutter-apk/app-release.apk | ||
| - name: Install Firebase CLI | ||
| run: npm install -g firebase-tools | ||
| - name: Distribute APK via Firebase | ||
| if: ${{ secrets.FIREBASE_APP_ID != '' && secrets.FIREBASE_TOKEN != '' }} | ||
| run: | | ||
| firebase appdistribution:distribute build/app/outputs/flutter-apk/app-release.apk \ | ||
| --app ${{ secrets.FIREBASE_APP_ID }} \ | ||
| --groups testers \ | ||
| --token ${{ secrets.FIREBASE_TOKEN }} | ||
| build-ios: | ||
| name: Build iOS for TestFlight | ||
| runs-on: macos-latest | ||
| needs: build-android | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: stable | ||
| - name: Install dependencies | ||
| run: flutter pub get | ||
| - name: Build iOS | ||
| run: flutter build ios --release --no-codesign | ||
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '3.2' | ||
| - name: Install Fastlane | ||
| run: gem install fastlane | ||
| - name: Fastlane Match Setup | ||
| run: | | ||
| fastlane match appstore | ||
| env: | ||
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||
| GIT_AUTHORIZATION: ${{ secrets.MATCH_GIT_AUTH }} | ||
| - name: Deploy to TestFlight | ||
| run: | | ||
| cd ios | ||
| fastlane beta | ||
| env: | ||
| APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} | ||
| APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }} | ||
| APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }} | ||