82 lines
2.6 KiB
YAML
82 lines
2.6 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
defaults:
|
|
run:
|
|
working-directory: packages/stream_chat_v1
|
|
|
|
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-11]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- run: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer
|
|
- name: Install RubyGems
|
|
run: |
|
|
cd ios
|
|
bundle install
|
|
- uses: subosito/[email protected]
|
|
with:
|
|
channel: 'stable'
|
|
- name: Flutter setup
|
|
run: |
|
|
flutter pub get
|
|
- name: Copy production config
|
|
run: echo "${{ secrets.PRODUCTION_CONFIG }}" > lib/app_config.dart
|
|
- name: Build and release
|
|
env:
|
|
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
|
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
|
|
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
|
|
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
|
|
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
|
|
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
|
|
run: |
|
|
flutter build ios --release --no-codesign
|
|
cd ios
|
|
bundle exec fastlane deploy_to_testflight
|
|
build_and_deploy_android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-java@v1
|
|
with:
|
|
java-version: '12.x'
|
|
- uses: subosito/[email protected]
|
|
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
|
|
uses: actions/upload-artifact@v2
|
|
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@v1
|
|
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
|
|
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
|
|
|
|
|