Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit76451e7

Browse files
committed
Refactor github actions
+ just use shell scripts, not docker image.+ rewrite transifex pull command to speed up.+ show error message with logging commands.
1 parentd499d11 commit76451e7

File tree

13 files changed

+123
-104
lines changed

13 files changed

+123
-104
lines changed

‎.github/actions/commit/Dockerfile

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

‎.github/actions/commit/action.yml

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

‎.github/actions/commit/entrypoint.sh

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

‎.github/actions/update/Dockerfile

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

‎.github/actions/update/action.yml

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

‎.github/actions/update/entrypoint.sh

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

‎.github/scripts/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -o pipefail
5+
6+
error() {
7+
whileread -r line;do
8+
echo
9+
echo ::error::"$line"
10+
done
11+
}
12+
13+
cd cpython/Doc||exit 1
14+
mkdir -p locales/"$LOCALE"/
15+
ln -sfn"$(realpath ../../docs)" locales/"$LOCALE"/LC_MESSAGES
16+
make venv
17+
make html SPHINXOPTS="-D language=$LOCALE -D gettext_compact=0 -W --keep-going -j2"2>>(error)

‎.github/scripts/commit.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
cd docs||exit 1
6+
git config user.email"github-actions[bot]@users.noreply.github.com"
7+
git config user.name"github-actions[bot]"
8+
if! git status -s|grep'\.po';then
9+
echo"Nothing to commit"
10+
exit 0
11+
fi
12+
git add.
13+
git commit -m'[po] auto sync'
14+
header="$(echo -n token:"$GITHUB_TOKEN"| base64)"
15+
git -c http.extraheader="AUTHORIZATION: basic$header" push

‎.github/scripts/prepare.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
git clone --depth=1 --branch="$VERSION" https://github.com/python/cpython cpython
6+
git clone --branch="$VERSION" https://github.com/"$GITHUB_REPOSITORY" docs
7+
8+
pip3 install --user setuptools
9+
pip3 install --user transifex-client
10+
sudo apt-get update
11+
sudo apt-get install -y python3-venv

‎.github/scripts/transifex_pull.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
3+
fromtxclibimportproject
4+
fromtxclib.utilsimportperform_parallel_requests
5+
6+
7+
defpull(path,lang):
8+
skip_decode=False
9+
params= {}
10+
parallel=True
11+
12+
prj=project.Project(path)
13+
resource_list=prj.get_chosen_resources([])
14+
forresourceinresource_list:
15+
project_slug,resource_slug=resource.split(".",1)
16+
host=prj.get_resource_host(resource)
17+
prj._set_url_info(host=host,project=project_slug,resource=resource_slug)
18+
19+
files=prj.get_resource_files(resource)
20+
url=prj._get_url_by_pull_mode(None)
21+
local_file=files.get(lang)
22+
prj.do_url_request(
23+
url,
24+
language=lang,
25+
skip_decode=skip_decode,
26+
params=params,
27+
parallel=parallel,
28+
callback=prj._save_file,
29+
callback_args={"local_file":local_file},
30+
)
31+
32+
perform_parallel_requests()
33+
34+
35+
if__name__=="__main__":
36+
importos
37+
38+
pull(os.getcwd(),os.getenv("LOCALE","zh_CN"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp