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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
if: ${{ runner.os == 'macOS' }}
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.13.0
version: 1.16.2

- name: Cache dependencies
id: yarn-cache
Expand Down
79 changes: 16 additions & 63 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
matrix:
newArch: [false, true]
env:
TURBO_CACHE_DIR: .turbo/android
turbo_cache_hit: 0
ORG_GRADLE_PROJECT_newArchEnabled: ${{ matrix.newArch }}
steps:
- name: Checkout
Expand All @@ -24,71 +22,40 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for Android
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ matrix.newArch }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-${{ matrix.newArch }}-

- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ matrix.newArch }}-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-${{ matrix.newArch }}-

- name: Modify APP ID
run: |
sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
mv tmp agora.config.ts
working-directory: example/src/config
working-directory: examples/expo/src/config

- name: Build example for Android
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force=true
yarn example build:android

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: AgoraRtcNgExample-Android-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
name: AgoraRtcNgExampleExpo-Android-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
path: |
example/android/app/build/outputs/apk/release/*.apk
examples/expo/android/app/build/outputs/apk/release/*.apk
if-no-files-found: error

build-ios:
runs-on: macos-latest
runs-on: macos-15
strategy:
matrix:
newArch: [false, true]
env:
TURBO_CACHE_DIR: .turbo/ios
turbo_cache_hit: 0
RCT_NEW_ARCH_ENABLED: ${{ matrix.newArch }}
steps:
- name: Checkout
Expand All @@ -101,34 +68,20 @@ jobs:
run: |
brew install fastlane

- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ matrix.newArch }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-${{ matrix.newArch }}-

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
uses: actions/cache@v3
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ matrix.newArch }}-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-${{ matrix.newArch }}-
- name: Switch Xcode
run: |
#https://github.com/actions/runner-images/issues/12758
sudo xcode-select --switch /Applications/Xcode_16.4.app

- name: Install cocoapods
run: |
yarn pod-install example/ios
yarn pod-install examples/expo/ios

- name: Modify APP ID
run: |
sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
mv tmp agora.config.ts
working-directory: example/src/config
working-directory: examples/expo/src/config

- name: Install the Apple certificate and provisioning profile
env:
Expand Down Expand Up @@ -161,22 +114,22 @@ jobs:

- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --force=true
yarn example build:ios

- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: AgoraRtcNgExample-iOS-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
name: AgoraRtcNgExampleExpo-iOS-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
path: |
example/ios/*.ipa
examples/expo/ios/*.ipa
if-no-files-found: error

- name: Upload dSYM
uses: actions/upload-artifact@v4
with:
name: AgoraRtcNgExampleSymbol-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
name: AgoraRtcNgExampleExpoSymbol-${{ matrix.newArch && 'NewArch' || 'OldArch' }}-${{ github.run_id }}
path: |
example/ios/*.dSYM.zip
examples/expo/ios/*.dSYM.zip
if-no-files-found: error

notification:
Expand Down
69 changes: 26 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,55 +68,24 @@ jobs:
newArch: [true, false]
runs-on: ubuntu-latest
env:
TURBO_CACHE_DIR: .turbo/android
ORG_GRADLE_PROJECT_newArchEnabled: ${{ matrix.newArch }}
turbo_cache_hit: 0
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for Android
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-detox-${{ matrix.newArch }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-detox-${{ matrix.newArch }}-

- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run detox:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'detox:android').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ matrix.newArch }}-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-${{ matrix.newArch }}-

- name: Install Detox dependencies
shell: bash
run: |
Expand All @@ -126,23 +95,33 @@ jobs:
run: |
sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
mv tmp agora.config.ts
working-directory: example/src/config
working-directory: examples/expo/src/config

- name: Build example for Android
run: |
yarn turbo run detox:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn example detox:android

- name: Clean Useless cache
run: |
rm -rf "${{ env.TURBO_CACHE_DIR }}" || true
rm -rf ~/.gradle/caches || true
rm -rf ~/.gradle/wrapper || true
sudo apt-get clean
npm cache clean --force
rm -rf example/ios
rm -rf examples/**/ios
yarn cache clean
df -h

- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand All @@ -157,16 +136,15 @@ jobs:
api-level: 31
arch: x86_64
avd-name: emulator
working-directory: example
working-directory: examples/expo
script: detox test -c android.emu.release

test-ios:
strategy:
matrix:
newArch: [1, 0]
runs-on: macos-latest
runs-on: macos-15
env:
TURBO_CACHE_DIR: .turbo/ios
RCT_NEW_ARCH_ENABLED: ${{ matrix.newArch }}
steps:
- name: Checkout
Expand All @@ -177,7 +155,12 @@ jobs:

- name: Install cocoapods
run: |
yarn pod-install example/ios
yarn pod-install examples/expo/ios

- name: Switch Xcode
run: |
#https://github.com/actions/runner-images/issues/12758
sudo xcode-select --switch /Applications/Xcode_16.4.app

- name: Install Detox dependencies
shell: bash
Expand All @@ -190,20 +173,20 @@ jobs:
run: |
sed "s/localAppId = '\(.*\)'/localAppId = '${{ secrets.APP_ID }}'/g" agora.config.ts > tmp
mv tmp agora.config.ts
working-directory: example/src/config
working-directory: examples/expo/src/config

- name: Build example for iOS
run: |
yarn turbo run detox:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn example detox:ios

- uses: futureware-tech/simulator-action@v4
with:
model: 'iPhone 15'
model: 'iPhone 16'

- name: Run e2e tests
# https://github.com/wix/Detox/issues/3720#issuecomment-1347855162
if: ${{ matrix.newArch == 0 }}
working-directory: example
working-directory: examples/expo
run: |
detox clean-framework-cache
detox build-framework-cache
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/dep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Get dependencies
id: dep
uses: AgoraIO-Extensions/actions/.github/actions/dep@main
Expand All @@ -25,13 +28,22 @@ jobs:
run: |
sh scripts/dep.sh ${{ steps.dep.outputs.matches }}

- name: Setup
uses: ./.github/actions/setup
- name: Generate code and comment by terra
uses: AgoraIO-Extensions/actions/.github/actions/generate@main
with:
github-token: ${{ secrets.GH_TOKEN }}
generate-code: true
generate-comment: true
generate-code-command: |
sh generate-prepare.sh
sh generate-code.sh
generate-comment-command: |
sh generate-comment.sh

- name: Update example
run: |
rm -rf example/ios/Podfile.lock
yarn pod-install example/ios
rm -rf examples/expo/ios/Podfile.lock
yarn pod-install examples/expo/ios

- name: Create pull request
uses: AgoraIO-Extensions/actions/.github/actions/pr@main
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ on:
increment:
description: 'Increment "major", "minor", "patch", or "pre*" version; or specify version [default: "patch"]'
required: true
default: 'patch'
default: "patch"
type: string
dry-run:
description: 'Do not touch or write anything, but show the commands'
default: true
description: "Do not touch or write anything, but show the commands"
default: false
type: boolean

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
release-it:
runs-on: ubuntu-latest
Expand All @@ -27,9 +31,14 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Setup NPM auth token
- name: Update Node.js
uses: actions/setup-node@v3
with:
node-version: 23.7.0

- name: Update NPM
run: |
npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
npm install -g [email protected]

- name: Dry Run Release
if: ${{ inputs.dry-run }}
Expand All @@ -42,3 +51,8 @@ jobs:
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
yarn release ${{ inputs.increment }} --ci --npm.allowSameVersion

- name: print publish info
run: |
echo "[publish info][tag]: https://github.com/AgoraIO-Extensions/react-native-agora/releases/tag/v${{ inputs.increment }}"
echo "[publish info][url]: https://www.npmjs.com/package/react-native-agora/v/${{ inputs.increment }}"
Loading
Loading