Skip to content

Commit 26f6ec6

Browse files
authored
chore(actions)!: rework actions (#2547)
1 parent e2b5bed commit 26f6ec6

14 files changed

+304
-294
lines changed

.github/workflows/.cleanup-todo

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/check.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.
File renamed without changes.

.github/workflows/docs-checks.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Documentation Checks"
2+
3+
on:
4+
push:
5+
paths:
6+
- discord/
7+
- docs/
8+
- requirements/
9+
- pyproject.toml
10+
- setup.py
11+
pull_request:
12+
paths:
13+
- discord/
14+
- docs/
15+
- requirements/
16+
- pyproject.toml
17+
- setup.py
18+
workflow_dispatch:
19+
schedule:
20+
- cron: "0 0 * * *"
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
24+
cancel-in-progress: true
25+
26+
permissions: write-all
27+
28+
jobs:
29+
docs:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: "Checkout Repository"
33+
uses: actions/checkout@v4
34+
- name: "Setup Python"
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.12"
38+
cache: "pip"
39+
cache-dependency-path: "requirements/docs.txt"
40+
check-latest: true
41+
- name: Install dependencies
42+
run: |
43+
python -m pip install -U pip
44+
pip install ".[docs]"
45+
- name: "Check Links"
46+
if: ${{ github.event_name == 'schedule' }}
47+
run: |
48+
cd docs
49+
make linkcheck
50+
- name: "Compile to html"
51+
run: |
52+
cd docs
53+
make -e SPHINXOPTS="-D language='en'" html

.github/workflows/docs-localization-download.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
name: Multilingual Docs Download
1+
name: "Multilingual Docs Download"
22

33
on:
44
workflow_dispatch:
55

6+
permissions: write-all
7+
68
jobs:
79
download:
8-
permissions: write-all
910
name: "Download localizations from Crowdin"
1011
runs-on: ubuntu-latest
1112
outputs:
1213
pr_ref: ${{ steps.convert_outputs.outputs.pr_ref }}
1314
pr_id: ${{ steps.convert_outputs.outputs.pr_id }}
1415
steps:
15-
- name: Checkout Repository
16+
- name: "Checkout Repository"
1617
uses: actions/checkout@v4
1718
with:
1819
fetch-tags: true
@@ -34,8 +35,7 @@ jobs:
3435
working-directory: ./docs
3536
- name: "Build locales"
3637
run:
37-
sphinx-intl update -p ./build/locales -l ja -l de -l ja -l fr -l it -l en -l
38-
hi -l ko -l pt_BR -l es -l zh_CN -l ru
38+
sphinx-intl update -p ./build/locales -l ja -l de -l ja -l fr -l it -l en -l hi -l ko -l pt_BR -l es -l zh_CN -l ru
3939
working-directory: ./docs
4040
- name: "Crowdin"
4141
id: crowdin
@@ -48,9 +48,7 @@ jobs:
4848
localization_branch_name: l10n_master
4949
create_pull_request: true
5050
pull_request_title: "docs: Update localizations from Crowdin"
51-
pull_request_body:
52-
"Crowdin download was triggered due to completely translated file or
53-
project. Starting sync. CC @Lulalaby"
51+
pull_request_body: "Crowdin download was triggered due to completely translated file or project. Starting sync. CC @Lulalaby"
5452
pull_request_base_branch_name: "master"
5553
pull_request_reviewers: "Lulalaby"
5654
config: "crowdin.yml"
@@ -69,14 +67,13 @@ jobs:
6967
echo "pr_id=$(echo -n "$PR_ID" | base64)" >> $GITHUB_OUTPUT
7068
7169
pr:
72-
permissions: write-all
7370
name: "PR operations"
7471
needs: [download]
7572
runs-on: ubuntu-latest
7673
steps:
77-
- name: Checkout Repository
74+
- name: "Checkout Repository"
7875
uses: actions/checkout@v4
79-
- name: Refresh Pull
76+
- name: "Refresh Pull"
8077
run: |
8178
git fetch --all
8279
git reset --hard origin/master
@@ -123,11 +120,14 @@ jobs:
123120
#with:
124121
#workflow: version-updates.yml
125122
#ref: ${{ steps.convert_outputs.outputs.pr_ref }}
126-
- run: gh pr merge --auto --squash $PR_ID
123+
- name: "Auto Approve"
124+
run: gh pr review --approve -b "auto-approval for localization sync :3" "$PR_ID"
127125
env:
128126
PR_ID: ${{ steps.convert_outputs.outputs.pr_id }}
129-
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
130-
- run: gh pr review --approve -b "auto-approval for localization sync :3" "$PR_ID"
127+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128+
- name: "Enable Auto Merge"
129+
if: ${{ always() }}
130+
run: gh pr merge --auto --squash $PR_ID
131131
env:
132132
PR_ID: ${{ steps.convert_outputs.outputs.pr_id }}
133-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133+
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}

.github/workflows/docs-localization-upload.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
name: Multilingual Docs Upload
1+
name: "Multilingual Docs Upload"
22

33
on:
44
push:
55
branches:
66
- master
77
workflow_dispatch:
8+
9+
permissions: write-all
810

911
jobs:
1012
upload:
11-
permissions: write-all
1213
name: "Upload localization base to Crowdin"
1314
runs-on: ubuntu-latest
14-
if:
15-
contains(github.event.head_commit.message, '!crowdin upload') || github.event_name
16-
== 'workflow_dispatch'
15+
if: ${{ contains(github.event.head_commit.message, '!crowdin upload') || github.event_name == 'workflow_dispatch' }}
1716
steps:
1817
- uses: actions/checkout@v4
1918
- name: "Install Python"
@@ -34,8 +33,7 @@ jobs:
3433
working-directory: ./docs
3534
- name: "Build locales"
3635
run:
37-
sphinx-intl update -p ./build/locales -l ja -l de -l ja -l fr -l it -l en -l
38-
hi -l ko -l pt_BR -l es -l zh_CN -l ru
36+
sphinx-intl update -p ./build/locales -l ja -l de -l ja -l fr -l it -l en -l hi -l ko -l pt_BR -l es -l zh_CN -l ru
3937
working-directory: ./docs
4038
- name: "Crowdin"
4139
uses: crowdin/github-action@v2

0 commit comments

Comments
 (0)