-
Notifications
You must be signed in to change notification settings - Fork 375
132 lines (126 loc) · 5.07 KB
/
Copy pathsample-distribution.yml
File metadata and controls
132 lines (126 loc) · 5.07 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: sample-distribution
concurrency:
group: sample-distribution-${{ github.ref }}
cancel-in-progress: true
on:
push:
paths:
- '.github/workflows/sample-distribution.yml'
- 'package/**'
- 'examples/SampleApp/**'
permissions:
actions: write
contents: read
jobs:
build_and_deploy_ios_testflight_qa:
name: Build SampleApp iOS and Deploy-${{ github.ref == 'refs/heads/develop' }}
runs-on: [macos-15]
strategy:
matrix:
node-version: [24.x]
steps:
- name: Connect Bot
uses: webfactory/ssh-agent@v0.10.0
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.2' # Update as needed
- 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@v5
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: |
rm -rf Pods
rm -f Podfile.lock
rm -rf build
rm -rf ~/Library/Developer/Xcode/DerivedData
bundle exec pod install
- name: Build and release Testflight QA
working-directory: examples/SampleApp
run: bundle exec fastlane ios 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_firebase:
name: Build SampleApp Android and Deploy-${{ github.ref == 'refs/heads/develop' }}
runs-on: public
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
- name: Setup Android SDK
uses: amyu/setup-android@v5
- uses: ./.github/actions/ruby-cache
- name: Install && Build - SDK and Sample App
uses: ./.github/actions/install-and-build-sdk
- name: Build and deploy Android Firebase
working-directory: examples/SampleApp
run: bundle exec fastlane android firebase_build_and_upload deploy:${{ github.ref == 'refs/heads/develop' }};
env:
ANDROID_FIREBASE_APP_ID: ${{ secrets.ANDROID_FIREBASE_APP_ID }}
FIREBASE_CREDENTIALS_JSON: ${{ secrets.FIREBASE_CREDENTIALS_JSON }}
# Publish the same APK to S3 for the public download link. Reuses the
# artifact the Fastlane step above already built (app-build/), no rebuild.
- name: Ensure AWS CLI is available
if: github.ref == 'refs/heads/develop'
# The self-hosted `public` runner does not ship the AWS CLI. Install v2
# only when missing, to a user-writable dir (no sudo), then expose it.
run: |
if command -v aws >/dev/null 2>&1; then
echo "AWS CLI already installed: $(aws --version)"
exit 0
fi
echo "AWS CLI not found; installing v2..."
case "$(uname -m)" in
x86_64) zip="awscli-exe-linux-x86_64.zip" ;;
aarch64|arm64) zip="awscli-exe-linux-aarch64.zip" ;;
*) echo "Unsupported architecture: $(uname -m)"; exit 1 ;;
esac
curl -fsSL "https://awscli.amazonaws.com/${zip}" -o /tmp/awscliv2.zip
unzip -q /tmp/awscliv2.zip -d /tmp
/tmp/aws/install --bin-dir "$HOME/.local/bin" --install-dir "$HOME/.local/aws-cli" --update
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/aws" --version
- name: Configure AWS credentials
if: github.ref == 'refs/heads/develop'
uses: aws-actions/configure-aws-credentials@v4
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 to S3
if: github.ref == 'refs/heads/develop'
working-directory: examples/SampleApp
# Public download link: https://getstream.io/downloads/rn-sample-app.apk
run: |
cp app-build/reactnativesampleapp.apk rn-sample-app.apk
aws s3 cp rn-sample-app.apk s3://${{ secrets.AWS_S3_BUCKET }} --sse AES256