forked from Rapptz/discord.py
-
Notifications
You must be signed in to change notification settings - Fork 168
39 lines (32 loc) · 1.31 KB
/
rename.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Rename
on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
rename:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Replace instances
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git checkout -b temp master
cp .github/files/README.rst README.rst
rm -rf docs .github .readthedocs.yml tests
mv discord selfcord
sed -i -e 's/import discord/import selfcord/g' -e '/from discord_protos/!{s/from discord/from selfcord/g}' -e '/from discord_protos/!{s/from discord/from selfcord/g}' -e 's/discord\.py-self/selfcord\.py/g' -e '/\(discord\.com\|discord\.gg\|discord\.new\)/! s/discord\./selfcord\./g' $(find selfcord examples -name "*.py")
sed -i -e 's/discord/selfcord/g' pyproject.toml MANIFEST.in
sed -i -e "s/prefix = 'discord'/prefix = 'selfcord'/" setup.py
- name: Push changes
run: |
git add .
git stash
git switch renamed
git checkout stash -- .
(git commit -am "Synchronize selfcord") || true
(git push origin renamed) || true