Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/actions/install-and-build-sdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ runs:
cd package/native-package/
yarn
shell: bash
- name: Install & Build the Expo Package
run: |
cd package/expo-package/
yarn
shell: bash
- name: Install & Build the Sample App
working-directory: examples/SampleApp
run: yarn
Expand Down
34 changes: 10 additions & 24 deletions .github/workflows/sample-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: [macos-15]
strategy:
matrix:
node-version: [ 24.x ]
node-version: [24.x]
steps:
- name: Connect Bot
uses: webfactory/[email protected]
Expand Down Expand Up @@ -51,18 +51,18 @@ jobs:
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' }};
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_s3:
build_and_deploy_android_firebase:
name: Build SampleApp Android and Deploy-${{ github.ref == 'refs/heads/develop' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 24.x ]
node-version: [24.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand All @@ -74,26 +74,12 @@ jobs:
distribution: 'zulu'
java-version: '17'
check-latest: true
- uses: ./.github/actions/ruby-cache
- name: Install && Build - SDK and Sample App
uses: ./.github/actions/install-and-build-sdk
- name: Build
- name: Build and deploy Android Firebase
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
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 }}
4 changes: 4 additions & 0 deletions examples/SampleApp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ yarn-error.log
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Credentials
credentials/
app-build/
6 changes: 3 additions & 3 deletions examples/SampleApp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ android {

buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.sampleapp"
namespace "io.getstream.reactnative.sampleapp"

defaultConfig {
applicationId "com.sampleapp"
applicationId "io.getstream.reactnative.sampleapp"
minSdkVersion rootProject.ext.minSdkVersion
multiDexEnabled true
targetSdkVersion rootProject.ext.targetSdkVersion
vectorDrawables.useSupportLibrary = true
versionCode 22
versionCode 1
versionName "0.0.22"
}

Expand Down
4 changes: 2 additions & 2 deletions examples/SampleApp/android/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"client_info": {
"mobilesdk_app_id": "1:674907137625:android:5effa1cd0fef9003d7f348",
"android_client_info": {
"package_name": "com.sampleapp"
"package_name": "io.getstream.reactnative.sampleapp"
}
},
"oauth_client": [
Expand Down Expand Up @@ -98,7 +98,7 @@
"client_info": {
"mobilesdk_app_id": "1:674907137625:android:07c76802bbfd5654d7f348",
"android_client_info": {
"package_name": "com.sampleapp.rnpushtest"
"package_name": "io.getstream.reactnative.sampleapp.rnpushtest"
}
},
"oauth_client": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sampleapp;
package io.getstream.reactnative.sampleapp;

import com.wix.detox.Detox;
import com.wix.detox.config.DetoxConfig;
Expand All @@ -24,7 +24,7 @@ public void runDetoxTests() {
DetoxConfig detoxConfig = new DetoxConfig();
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
detoxConfig.rnContextLoadTimeoutSec = (com.sampleapp.BuildConfig.DEBUG ? 180 : 60);
detoxConfig.rnContextLoadTimeoutSec = (io.getstream.reactnative.sampleapp.BuildConfig.DEBUG ? 180 : 60);

Detox.runTests(mActivityRule, detoxConfig);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sampleapp
package io.getstream.reactnative.sampleapp

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sampleapp
package io.getstream.reactnative.sampleapp

import android.app.Application
import com.facebook.react.PackageList
Expand Down
175 changes: 112 additions & 63 deletions examples/SampleApp/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
default_platform(:ios)
skip_docs

# Common Configuration
github_repo = ENV['GITHUB_REPOSITORY'] || 'GetStream/stream-chat-react-native'
bundle_id = 'io.getstream.reactnative.SampleApp'
xcode_project = 'ios/SampleApp.xcodeproj'
xcode_workspace = 'ios/SampleApp.xcworkspace'
root_path = File.absolute_path('../../../')
sdk_size_ext = 'KB'
@force_check = false
build_output_directory = "./app-build"

# iOS Platform Configuration
bundle_id = 'io.getstream.reactnative.SampleApp'
xcode_project = 'ios/SampleApp.xcodeproj'
xcode_workspace = 'ios/SampleApp.xcworkspace'
output_ipa_name = "reactnativesampleapp.ipa"

# Android Platform Configuration
package_name = 'io.getstream.reactnative.sampleapp'
output_apk_name = "reactnativesampleapp.apk"
apk_path = "#{build_output_directory}/#{output_apk_name}"


before_all do
if is_ci
Expand All @@ -20,82 +30,121 @@ end
###### iOS lanes ######
#######################

lane :deploy_to_testflight_qa do |options|
match_me

settings_to_override = {
BUNDLE_IDENTIFIER: bundle_id,
PROVISIONING_PROFILE_SPECIFIER: "match AppStore #{bundle_id}"
}

increment_version_number(
version_number: load_json(json_path: './package.json')['version'],
xcodeproj: xcode_project
)

current_build_number = app_store_build_number(
api_key: appstore_api_key,
live: false,
app_identifier: bundle_id
platform :ios do
lane :deploy_to_testflight_qa do |options|
match_me

deploy = options.fetch(:deploy, false)

UI.message("Deploying to Testflight: #{deploy}")

settings_to_override = {
BUNDLE_IDENTIFIER: bundle_id,
PROVISIONING_PROFILE_SPECIFIER: "match AppStore #{bundle_id}"
}

gym(
workspace: xcode_workspace,
scheme: 'SampleApp',
export_method: 'app-store',
export_options: './fastlane/testflight_gym_export_options.plist',
silent: true,
clean: true,
xcargs: settings_to_override,
include_symbols: true,
output_directory: build_output_directory
)

increment_build_number(
build_number: current_build_number + 1,
xcodeproj: xcode_project
)
if deploy
increment_version_number(
version_number: load_json(json_path: './package.json')['version'],
xcodeproj: xcode_project
)

gym(
workspace: xcode_workspace,
scheme: 'SampleApp',
export_method: 'app-store',
export_options: './fastlane/testflight_gym_export_options.plist',
silent: true,
clean: true,
xcargs: settings_to_override,
include_symbols: true,
output_directory: './dist'
)
current_build_number = app_store_build_number(
api_key: appstore_api_key,
live: false,
app_identifier: bundle_id
)

increment_build_number(
build_number: current_build_number + 1,
xcodeproj: xcode_project
)

if options[:deploy]
begin
upload_to_testflight(
groups: ['Testers'],
changelog: 'Lots of amazing new features to test out!',
reject_build_waiting_for_review: false
reject_build_waiting_for_review: false,
ipa: "#{build_output_directory}/#{output_ipa_name}"
)
rescue StandardError => e
if e.message.include?('Another build is in review')
UI.important('Another build is already in beta review. Skipping beta review submission')
else
UI.user_error!(e)
end
else
UI.message("Skipping Testflight upload! (deploy: #{deploy})")
end
end
end

private_lane :appstore_api_key do
@appstore_api_key ||= app_store_connect_api_key(
key_id: 'MT3PRT8TB7',
issuer_id: '69a6de96-0738-47e3-e053-5b8c7c11a4d1',
key_content: ENV.fetch('APPSTORE_API_KEY', nil),
in_house: false
)
end

desc "If `readonly: true` (by default), installs all Certs and Profiles necessary for development and ad-hoc.\nIf `readonly: false`, recreates all Profiles necessary for development and ad-hoc, updates them locally and remotely."
lane :match_me do |options|
custom_match(
api_key: appstore_api_key,
app_identifier: [bundle_id],
readonly: options[:readonly],
register_device: options[:register_device]
)
private_lane :appstore_api_key do
@appstore_api_key ||= app_store_connect_api_key(
key_id: 'MT3PRT8TB7',
issuer_id: '69a6de96-0738-47e3-e053-5b8c7c11a4d1',
key_content: ENV.fetch('APPSTORE_API_KEY', nil),
in_house: false
)
end

desc "If `readonly: true` (by default), installs all Certs and Profiles necessary for development and ad-hoc.\nIf `readonly: false`, recreates all Profiles necessary for development and ad-hoc, updates them locally and remotely."
lane :match_me do |options|
custom_match(
api_key: appstore_api_key,
app_identifier: [bundle_id],
readonly: options[:readonly],
register_device: options[:register_device]
)
end
end

###########################
###### Android lanes ######
###########################

platform :android do
lane :firebase_build_and_upload do |options|
deploy = options.fetch(:deploy, false)

UI.message("Deploying to Firebase: #{deploy}")

# Clean
gradle(
task: "clean",
project_dir: "./android"
)

# Build the AAB
gradle(
task: "assemble",
build_type: "Release",
project_dir: "./android"
)

Dir.chdir('..') do
sh("mkdir -p #{build_output_directory} && mv -f #{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]} #{apk_path}")
end

if deploy
# Upload to Firebase App Distribution
firebase_app_distribution(
app: ENV.fetch('ANDROID_FIREBASE_APP_ID', nil),
service_credentials_json: ENV.fetch('FIREBASE_CREDENTIALS_JSON', nil),
android_artifact_path: apk_path,
android_artifact_type: "APK",
groups: "stream-testers"
)
else
UI.message("Skipping Firebase upload! (deploy: #{deploy})")
end
end
end

##########################
###### Common lanes ######
##########################
Expand Down
6 changes: 5 additions & 1 deletion examples/SampleApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
"release-next": "echo \"Skipping next release for SampleApp\"",
"test:unit": "echo \"Skipping unit tests for SampleApp\"",
"clean": "watchman watch-del-all && yarn cache clean && rm -rf ios/build && pod cache clean --all && rm -rf android/build && cd android && ./gradlew clean && cd -",
"clean-all": "yarn clean && rm -rf node_modules && rm -rf ios/Pods && rm -rf vendor && bundle install && yarn install && cd ios && bundle exec pod install && cd -"
"clean-all": "yarn clean && rm -rf node_modules && rm -rf ios/Pods && rm -rf vendor && bundle install && yarn install && cd ios && bundle exec pod install && cd -",
"fastlane:android-build": "bundle exec fastlane android firebase_build_and_upload deploy:false",
"fastlane:android-deploy": "bundle exec fastlane android firebase_build_and_upload deploy:true",
"fastlane:ios-build": "bundle exec fastlane ios deploy_to_testflight_qa deploy:false",
"fastlane:ios-deploy": "bundle exec fastlane ios deploy_to_testflight_qa deploy:true"
},
"dependencies": {
"@emoji-mart/data": "^1.2.1",
Expand Down
Loading