Skip to content

Merge pull request #2823 from GetStream/develop #1874

Merge pull request #2823 from GetStream/develop

Merge pull request #2823 from GetStream/develop #1874

name: sample-distribution
concurrency:
group: sample-distribution-${{ github.ref }}
cancel-in-progress: true
on:
push:
paths:
- '.github/workflows/sample-distribution.yml'
- 'package/**'
- 'examples/SampleApp/**'
jobs:
build_and_deploy_ios_testflight_qa:
name: Build SampleApp iOS and Deploy-${{ github.ref == 'refs/heads/develop' }}
runs-on: [macos-14]
steps:
- name: Connect Bot
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- uses: actions/checkout@v2
- uses: ./.github/actions/ruby-cache
- name: Install && Build - SDK and Sample App
uses: ./.github/actions/install-and-build-sdk
- name: Cache iOS pods
uses: actions/cache@v2
with:
path: examples/SampleApp/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('examples/SampleApp/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: iOS Pods setup
working-directory: examples/SampleApp/ios
run: bundle exec pod install
- name: Build and release Testflight QA
working-directory: examples/SampleApp
run: bundle exec fastlane deploy_to_testflight_qa deploy:${{ github.ref == 'refs/heads/develop' }};
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
build_and_deploy_android_s3:
name: Build SampleApp Android and Deploy-${{ github.ref == 'refs/heads/develop' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
- name: Install && Build - SDK and Sample App
uses: ./.github/actions/install-and-build-sdk
- name: Build
working-directory: examples/SampleApp
run: |
mkdir android/app/src/main/assets
mkdir tmp
yarn react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest tmp
cd android
rm -rf $HOME/.gradle/caches/ && ./gradlew assembleRelease
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
if: ${{ github.ref == 'refs/heads/develop' }}
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
if: ${{ github.ref == 'refs/heads/develop' }}
# https://getstream.io/downloads/rn-sample-app.apk
run: |
cp examples/SampleApp/android/app/build/outputs/apk/release/app-release.apk rn-sample-app.apk
aws s3 cp rn-sample-app.apk s3://${{ secrets.AWS_S3_BUCKET }} --sse AES256