Browse Source

Cleanup workflow actions

pull/10109/head
dolfies 3 years ago
parent
commit
f7f31baf87
  1. 15
      .github/workflows/build.yml
  2. 17
      .github/workflows/lint.yml
  3. 30
      .github/workflows/publish.yml
  4. 32
      .github/workflows/python-publish.yml
  5. 53
      .github/workflows/rename.yml
  6. 15
      .github/workflows/test.yml

15
.github/workflows/build.yml

@ -1,4 +1,4 @@
name: build
name: Build
on:
push:
@ -8,21 +8,16 @@ on:
jobs:
dists-and-docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.8' ]
name: dists & docs
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up CPython ${{ matrix.python-version }}
- name: Set up CPython 3.8
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: '3.8'
- name: Install dependencies
run: |

17
.github/workflows/lint.yml

@ -1,4 +1,4 @@
name: lint
name: Lint
on:
push:
@ -8,21 +8,16 @@ on:
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.8' ]
name: lint
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up CPython ${{ matrix.python-version }}
- name: Set up CPython 3.8
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: '3.8'
- name: Install dependencies
id: install-deps
@ -30,7 +25,7 @@ jobs:
python -m pip install --upgrade pip setuptools wheel black
pip install -U -r requirements.txt
- name: Setup node.js
- name: Set up node.js
uses: actions/setup-node@v2
with:
node-version: '16'

30
.github/workflows/publish.yml

@ -0,0 +1,30 @@
name: Publish
on:
workflow_dispatch:
release:
types: [ created ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up CPython 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

32
.github/workflows/python-publish.yml

@ -1,32 +0,0 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload Python Package
on:
workflow_dispatch:
release:
types: [created]
jobs:
deploy:
name: push to PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

53
.github/workflows/rename.yml

@ -1,40 +1,39 @@
name: rename
name: Rename
on:
workflow_dispatch:
push:
branches:
- master
branches: [ master ]
jobs:
build:
rename:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- 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'
- 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
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 's/from discord/from selfcord/g' -e '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
sed -i -e 's/import discord/import selfcord/g' -e 's/from discord/from selfcord/g' -e '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 -- .
- 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
(git commit -am "Synchronize selfcord") || true
(git push origin renamed) || true

15
.github/workflows/test.yml

@ -1,4 +1,4 @@
name: test
name: Test
on:
push:
@ -8,21 +8,16 @@ on:
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.8' ]
name: pytest
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up CPython ${{ matrix.python-version }}
- name: Set up CPython 3.8
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: '3.8'
- name: Install dependencies
run: |

Loading…
Cancel
Save