name: Rename on: workflow_dispatch: push: branches: [ master ] # Runs do not need to be concurrent concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true 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' MANIFEST.in setup.py sed -i -E 's/^name = "discord\.py-self"/name = "selfcord.py"/; /http/!s/\bdiscord\b/selfcord/g' pyproject.toml - 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