Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync job #844

Merged
merged 2 commits into from
Dec 11, 2024
Merged
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
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"

Loading