-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
夏羊群
committed
Dec 19, 2024
1 parent
154309d
commit e5be149
Showing
5 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@sync | ||
with: | ||
target-repo: 'Electron-SDK' | ||
source-repo: 'Shengwang-Electron-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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# common.sh | ||
#!/bin/bash | ||
|
||
old_package_name='agora-electron-sdk' | ||
new_package_name='shengwang-electron-sdk' | ||
|
||
#./package.json | ||
old_name="\"name\": \"agora-electron-sdk\"" | ||
new_name="\"name\": \"shengwang-electron-sdk\"" | ||
|
||
old_description="\"description\": \"agora-electron-sdk\"" | ||
new_description="\"description\": \"shengwang-electron-sdk\"" | ||
|
||
old_yarn_link="yarn example link agora-electron-sdk" | ||
new_yarn_link="yarn example link shengwang-electron-sdk" | ||
|
||
# node_modules | ||
old_node_modules="node_modules/agora-electron-sdk" | ||
new_node_modules="node_modules/shengwang-electron-sdk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
MY_PATH=$(realpath $(dirname "$0")) | ||
PROJECT_ROOT=$(realpath ${MY_PATH}/../..) | ||
. ${PROJECT_ROOT}/scripts/publishCN/common.sh | ||
|
||
change_file=${PROJECT_ROOT}/package.json | ||
sed "s/${old_name}/${new_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_yarn_link}/${new_yarn_link}/g" ${change_file} >tmp && mv tmp ${change_file} | ||
|
||
change_file=${PROJECT_ROOT}/tsconfig.json | ||
sed "s/${old_package_name}/${new_package_name}/g" ${change_file} >tmp && mv tmp ${change_file} | ||
|
||
change_file=${PROJECT_ROOT}/.github/workflows/publish.yml | ||
sed "s/${old_package_name}/${new_package_name}/g" ${change_file} >tmp && mv tmp ${change_file} | ||
|
||
change_file=${PROJECT_ROOT}/ci/packager-mac.sh | ||
sed "s#${old_node_modules}#${new_node_modules}#g" ${change_file} >tmp && mv tmp ${change_file} | ||
|
||
change_file=${PROJECT_ROOT}/ci/packager-win.ps1 | ||
sed "s#${old_node_modules}#${new_node_modules}#g" ${change_file} >tmp && mv tmp ${change_file} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
MY_PATH=$(realpath $(dirname "$0")) | ||
PROJECT_ROOT=$(realpath ${MY_PATH}/../..) | ||
. ${PROJECT_ROOT}/scripts/publishCN/common.sh | ||
|
||
change_dir="${PROJECT_ROOT}/example/src" | ||
|
||
find "$change_dir" -type f | while read -r file; do | ||
sed -i.bak "s/${old_package_name}/${new_package_name}/g" "$file" | ||
echo "Replaced in $file" | ||
done | ||
|
||
change_file=${PROJECT_ROOT}/example/package.json | ||
sed "s/${old_package_name}/${new_package_name}/g" ${change_file} >tmp && mv tmp ${change_file} | ||
|
||
change_file=${PROJECT_ROOT}/example/webpack.renderer.additions.js | ||
sed "s/${old_package_name}/${new_package_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." |