Skip to content

Commit

Permalink
sync job (#844)
Browse files Browse the repository at this point in the history
prepare for sync
  • Loading branch information
guoxianzhe authored Dec 11, 2024
1 parent 5490539 commit 80ff469
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Sync to shengwang

on:
workflow_dispatch:

jobs:
generate-codes:
runs-on: ubuntu-latest
steps:
- name: Generate code and comment by terra
uses: AgoraIO-Extensions/actions/.github/actions/shengwang@sync
with:
target_repo: '[email protected]:AgoraIO-Extensions/react-native-shengwang.git'
target_branch: ${{ github.ref_name }}
pre-command: |
sh scripts/publishCN/rewrite.sh
36 changes: 36 additions & 0 deletions scripts/publishCN/rewrite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -e
MY_PATH=$(realpath $(dirname "$0"))
PROJECT_ROOT=$(realpath ${MY_PATH}/../..)

old_package_name='react-native-agora'
new_package_name='react-native-shenwang'

old_native_sdk_android_rtc='io.agora.rtc:full-sdk'
new_native_sdk_android_rtc='io.shengwang.rtc:full-sdk'
old_native_sdk_android_rtc_special='io.agora.rtc:agora-special-full'
new_native_sdk_android_rtc_special='io.shengwang.rtc:agora-special-full'
old_native_sdk_android_rtc_screen='io.agora.rtc:full-screen-sharing'
new_native_sdk_android_rtc_screen='io.shengwangw.rtc:full-screen-sharing'

old_native_sdk_iOS_rtc='AgoraRtcEngine_iOS'
new_native_sdk_iOS_rtc='AgoraRtcEngine_iOS'
old_native_sdk_iOS_rtc_special='AgoraRtcEngine_Special_iOS'
new_native_sdk_iOS_rtc_special='ShengwangRtcEngine_Special_iOS'

change_file=${PROJECT_ROOT}/react-native-agora.podspec
sed "s/${old_package_name}/${new_package_name}/g" ${change_file} > tmp && mv tmp ${change_file}
sed "s/${old_native_sdk_iOS_rtc}/${new_native_sdk_iOS_rtc}/g" ${change_file} > tmp && mv tmp ${change_file}
sed "s/${old_native_sdk_iOS_rtc_special}/${new_native_sdk_iOS_rtc_special}/g" ${change_file} > tmp && mv tmp ${change_file}
echo "${change_file} rewritten successfully"

change_file=${PROJECT_ROOT}/android/build.gradle
sed "s/${old_native_sdk_android_rtc}/${new_native_sdk_android_rtc}/g" ${change_file} > tmp && mv tmp ${change_file}
sed "s/${old_native_sdk_android_rtc_special}/${new_native_sdk_android_rtc_special}/g" ${change_file} > tmp && mv tmp ${change_file}
sed "s/${old_native_sdk_android_rtc_screen}/${new_native_sdk_android_rtc_screen}/g" ${change_file} > tmp && mv tmp ${change_file}
echo "${change_file} rewritten successfully"

change_file=${PROJECT_ROOT}/package.json
sed "s/${old_package_name}/${new_package_name}/g" ${change_file} > tmp && mv tmp ${change_file}
echo "${change_file} rewritten successfully"

0 comments on commit 80ff469

Please sign in to comment.