-
Notifications
You must be signed in to change notification settings - Fork 325
89 lines (84 loc) · 3.35 KB
/
sample-distribution.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: sample-distribution
concurrency:
group: sample-distribution-${{ github.ref }}
cancel-in-progress: true
on:
push:
paths:
- '.github/workflows/sample-distribution.yml'
- 'package/**'
- 'packages/examples/SampleApp/**'
jobs:
build_and_deploy_ios_testflight_qa:
name: Build SampleApp iOS and Deploy-${{ github.ref == 'refs/heads/develop' }}
runs-on: [macos-12]
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
- name: Install Ruby and Gems
uses: ruby/setup-ruby@v1
with:
working-directory: examples/SampleApp
bundler-cache: true
- 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
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: |
cd examples/SampleApp
cd ios
bundle exec pod install
- name: Build and release Testflight QA
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
run: |
cd examples/SampleApp
bundle exec fastlane deploy_to_testflight_qa deploy:${{ github.ref == 'refs/heads/develop' }};
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: '11'
check-latest: true
- name: Install && Build - SDK and Sample App
uses: ./.github/actions/install-and-build-sdk
- name: Build
run: |
cd examples/SampleApp
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