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

[WIP]ATLAS #2186

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
23 changes: 23 additions & 0 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Sync to shengwang

on:
workflow_dispatch:

jobs:
move-to-shengwang:
runs-on: ubuntu-latest
steps:
- name: Sync to shengwang
uses: AgoraIO-Extensions/actions/.github/actions/shengwang-sync@main
with:
target-repo: 'Shengwang-Flutter-SDK'
source-repo: 'Agora-Flutter-SDK'
github-token: ${{ secrets.GH_TOKEN }}
target-branch: ${{ github.ref_name }}
github-email: ${{ secrets.GIT_EMAIL }}
github-private-key: ${{ secrets.GH_PRIVATE_KEY }}
github-username: ${{ secrets.GIT_USERNAME }}
pre-command: |
sh scripts/publishCN/rewrite-dep.sh
sh scripts/publishCN/rewrite-example.sh
create-pr: true
14 changes: 14 additions & 0 deletions scripts/publishCN/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# common.sh
#!/bin/bash

old_package_name='Agora-Flutter-SDK'
new_package_name='Shengwang-Flutter-SDK'

old_name="agora_rtc_engine"
new_name="shengwang_rtc_engine"

old_description="Flutter plugin of Agora RTC SDK, allow you to simply integrate Agora"
new_description="Flutter plugin of Shengwang RTC SDK, allow you to simply integrate Shengwang"

old_link="www.agora.io"
new_link="www.shengwang.cn"
11 changes: 11 additions & 0 deletions scripts/publishCN/rewrite-dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e
MY_PATH=$(realpath $(dirname "$0"))
PROJECT_ROOT=$(realpath ${MY_PATH}/../..)
. ${PROJECT_ROOT}/scripts/publishCN/common.sh

change_file=${PROJECT_ROOT}/pubspec.yaml
sed "s/name: ${old_name}/name: ${new_name}/g" ${change_file} >tmp && mv tmp ${change_file}
sed "s/${old_package_name}/${new_package_name}/g" ${change_file} >tmp && mv tmp ${change_file}
sed "s/${old_description}/${new_description}/g" ${change_file} >tmp && mv tmp ${change_file}
sed "s/${old_link}/${new_link}/g" ${change_file} >tmp && mv tmp ${change_file}
22 changes: 22 additions & 0 deletions scripts/publishCN/rewrite-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

export LC_ALL=C

MY_PATH=$(realpath $(dirname "$0"))
PROJECT_ROOT=$(realpath ${MY_PATH}/../..)
. ${PROJECT_ROOT}/scripts/publishCN/common.sh

change_dir="${PROJECT_ROOT}/example/lib"

find "$change_dir" -type f | while read -r file; do
sed -i.bak "s/package:${old_name}\//package:${new_name}\//g" "$file"
echo "Replaced in $file"
done

change_file=${PROJECT_ROOT}/example/pubspec.yaml
sed "s/${old_name}:/${new_name}:/g" ${change_file} >tmp && mv tmp ${change_file}

find "$change_dir" -name "*.bak" -type f -delete

echo "All replacements completed successfully, and backup files have been deleted."
Loading