-
Notifications
You must be signed in to change notification settings - Fork 26
53 lines (42 loc) · 1.6 KB
/
translate.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Auto update compat branch
on:
push:
branches:
- master
paths: ['src/phub/**']
workflow_dispatch:
jobs:
translate:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Checkout master branch
uses: actions/checkout@v2
with:
ref: master
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest autopep8
- name: Run translation script
run: |
python .github/workflows/translate.py ./src/**/*.py
# - name: Run pytest
# run: python -m pytest
- name: Update Pyproject version
run: sed -i 's/requires-python = ">=3.11"/requires-python = ">=3.8"/' pyproject.toml
- name: Remove .pyc files and workflow files
run: |
find . -type f \( -name "*.pyc" -o -path "./.github/workflows/*" -o -path "./docs/*" \) -delete
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git checkout -b compat
git add .
git commit -m "Automatic translation"
git push -f origin compat