FIX: TTS 合成加超时兜底,修复三星 A06 系统语音无声/管线冻死 #114
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| pull_request: | |
| branches: [main, master] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| env: | |
| FLUTTER_VERSION: '3.41.5' | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| cache-key: flutter-${{ runner.os }}-${{ hashFiles('pubspec.lock') }} | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Run analyze | |
| run: flutter analyze --no-fatal-warnings --no-fatal-infos | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: analyze | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| cache-key: flutter-${{ runner.os }}-${{ hashFiles('pubspec.lock') }} | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Run tests | |
| run: flutter test | |
| build: | |
| needs: [analyze, test] | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ios, android] | |
| include: | |
| - platform: ios | |
| runner: macos-latest | |
| - platform: android | |
| runner: ubuntu-latest | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| cache-key: flutter-${{ runner.os }}-${{ hashFiles('pubspec.lock') }} | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Cache CocoaPods | |
| if: matrix.platform == 'ios' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ios/Pods | |
| key: pods-${{ runner.os }}-${{ hashFiles('ios/Podfile.lock') }} | |
| restore-keys: pods-${{ runner.os }}- | |
| - name: Install CocoaPods | |
| if: matrix.platform == 'ios' | |
| run: cd ios && pod install | |
| - name: Build iOS (no codesign) | |
| if: matrix.platform == 'ios' | |
| run: | | |
| flutter build ios --release --no-codesign --flavor=prod \ | |
| --dart-define=API_BASE_URL=${{ vars.API_BASE_URL }} \ | |
| --dart-define=POSTHOG_HOST=${{ vars.POSTHOG_HOST }} \ | |
| --dart-define=SUPABASE_URL=${{ vars.SUPABASE_URL }} \ | |
| --dart-define=SUPABASE_PUBLISHABLE_KEY=${{ vars.SUPABASE_PUBLISHABLE_KEY }} \ | |
| --dart-define=GOOGLE_WEB_CLIENT_ID=${{ vars.GOOGLE_WEB_CLIENT_ID }} | |
| - name: Setup Java | |
| if: matrix.platform == 'android' | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Restore Android signing config | |
| if: matrix.platform == 'android' | |
| env: | |
| ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
| ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | |
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
| run: | | |
| echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > android/app/upload-keystore.jks | |
| cat > android/key.properties <<EOF | |
| storePassword=$ANDROID_KEYSTORE_PASSWORD | |
| keyPassword=$ANDROID_KEY_PASSWORD | |
| keyAlias=$ANDROID_KEY_ALIAS | |
| storeFile=../app/upload-keystore.jks | |
| EOF | |
| - name: Build Android APK | |
| if: matrix.platform == 'android' | |
| run: | | |
| flutter clean | |
| flutter build apk --release --flavor=prod \ | |
| --target-platform android-arm64 \ | |
| --dart-define=API_BASE_URL=${{ vars.API_BASE_URL }} \ | |
| --dart-define=POSTHOG_HOST=${{ vars.POSTHOG_HOST }} \ | |
| --dart-define=SUPABASE_URL=${{ vars.SUPABASE_URL }} \ | |
| --dart-define=SUPABASE_PUBLISHABLE_KEY=${{ vars.SUPABASE_PUBLISHABLE_KEY }} \ | |
| --dart-define=GOOGLE_WEB_CLIENT_ID=${{ vars.GOOGLE_WEB_CLIENT_ID }} |