chore(sample-app): update workflow and fix flutter web for deployment

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-04-08 02:48:30 +05:30
committed by xsahil03x
parent 72f322c2b3
commit c77221a61e
3 changed files with 122 additions and 69 deletions
+46 -33
View File
@@ -15,55 +15,59 @@ concurrency:
cancel-in-progress: true
jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_deploy_ios:
runs-on: macos-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
- run: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer
- name: Install RubyGems
run: |
cd ios
bundle install
- uses: subosito/flutter-action@v2
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
channel: stable
cache: true
- name: Setup Ruby and Gems
uses: ruby/setup-ruby@v1
with:
working-directory: ios
bundler-cache: true
- name: Install firebase-tools
run: npm install -g firebase-tools
- name: Flutter setup
run: |
flutter pub get
- name: Build and release
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
run: |
flutter build ios --release --no-codesign
flutter build ios --no-codesign
cd ios
bundle exec fastlane deploy_to_firebase
build_and_deploy_android:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v2
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: |
flutter pub get
channel: stable
cache: true
- name: Build
run: |
flutter build apk
run: flutter build apk
- name: Deploy
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
@@ -72,7 +76,8 @@ jobs:
groups: stream-testers
debug: true
file: packages/stream_chat_v1/build/app/outputs/apk/release/app-release.apk
- name: upload apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: android-stream-chat-v1
@@ -80,20 +85,28 @@ jobs:
build_and_deploy_web:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
- name: config git
run: |
git config --global user.email "$(git log --format='%ae' HEAD^!)"
git config --global user.name "$(git log --format='%an' HEAD^!)"
git fetch origin gh-pages:gh-pages
- uses: subosito/flutter-action@v2
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
channel: stable
cache: true
- name: Copy production config
run: echo "${{ secrets.PRODUCTION_CONFIG }}" > lib/app_config.dart
- uses: bluefireteam/flutter-gh-pages@v7
- name: Build and Deploy
uses: bluefireteam/flutter-gh-pages@v7
with:
webRenderer: canvaskit
workingDir: packages/stream_chat_v1