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

Signed-off-by: xsahil03x <xdsahil@gmail.com>
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
+37 -23
View File
@@ -17,21 +17,26 @@ concurrency:
jobs:
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'
- name: Flutter setup
run: |
flutter pub get
channel: stable
cache: true
- name: Setup Ruby and Gems
uses: ruby/setup-ruby@v1
with:
working-directory: ios
bundler-cache: true
- name: Copy production config
run: echo "${{ secrets.PRODUCTION_CONFIG }}" > lib/app_config.dart
- name: Build and release
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
@@ -41,39 +46,48 @@ jobs:
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
run: |
flutter build ios --release --no-codesign
flutter build ios --no-codesign
cd ios
bundle exec fastlane deploy_to_testflight
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 Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: |
flutter pub get
- name: Copy production config
run: echo "${{ secrets.PRODUCTION_CONFIG }}" > lib/app_config.dart
- name: Build
run: |
flutter build apk
- name: upload apk
run: flutter build apk
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: android-stream-chat-v1
path: packages/stream_chat_v1/build/app/outputs/apk/release/app-release.apk
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload APK
- name: Upload to S3
run: |
cp build/app/outputs/apk/release/app-release.apk flutter-sample-app.apk
aws s3 cp flutter-sample-app.apk s3://${{ secrets.AWS_S3_BUCKET }} --sse AES256
+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