forked from python/python-docs-pt-br
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (147 loc) · 5.36 KB
/
pythonpackage.yml
File metadata and controls
155 lines (147 loc) · 5.36 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build and update documentation
# Daily at 23 pm
on:
schedule:
- cron: '0 23 * * *'
# Branch where translation takes place
env:
BRANCH: '3.10'
jobs:
# Job to pull, build and push translations from Transifex to the repository
update:
if: (github.event_name == 'schedule' && github.repository == 'python/python-docs-pt-br') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
strategy:
max-parallel: 4
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH }}
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: sudo apt update
- run: sudo apt install -y gettext
- run: make tx-config
- name: Run make pull
run: |
if [[ -n "$TRANSIFEX_APIKEY" ]]; then
echo -e "[https://www.transifex.com]\n" \
"api_hostname = https://api.transifex.com\n" \
"hostname = https://www.transifex.com\n" \
"password = $TRANSIFEX_APIKEY\n" \
"username = api" \
> ~/.transifexrc
fi
make pull
git status --short
env:
TRANSIFEX_APIKEY: ${{ secrets.TRANSIFEX_APIKEY }}
- run: make build CPYTHON_PATH=/tmp/cpython/ SPHINXERRORHANDLING=''
- name: Run make push
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
make push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: appleboy/telegram-action@master
if: ${{ failure() }}
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
args: "❌ Falha na execução do workflow, job *${{ github.job }}* (ID *${{ github.run_id }}*). [Saiba mais sobre o erro...](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
# Job to check spelling of translations
spellcheck:
if: (github.event_name == 'schedule' && github.repository == 'python/python-docs-pt-br') || (github.event_name != 'schedule')
needs: update
runs-on: ubuntu-latest
strategy:
max-parallel: 4
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH }}
- uses: actions/setup-python@v2
- run: sudo apt update
- run: sudo apt install -y gettext hunspell hunspell-pt-br
- name: Run make spell
run: |
make spell
cd .pospell/
tar -czf ../pospell-out.tar.gz *.txt **/*.txt
- name: Update artifact spellchecking-output
uses: actions/upload-artifact@v2
with:
name: spellchecking-output
path: pospell-out.tar.gz
# Job to create a compendium to ease searching translated strings
compendium:
if: (github.event_name == 'schedule' && github.repository == 'python/python-docs-pt-br') || (github.event_name != 'schedule')
needs: update
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH }}
- uses: actions/setup-python@v2
- run: pip install translate-toolkit powrap
- run: sudo apt update
- run: sudo apt install -y gettext
- run: pocompendium --correct compendium.po *.po **/*.po
- run: powrap --no-wrap compendium.po
- run: tar -czf compendium.tar.gz compendium.po
- name: Update artifact spellchecking-output
uses: actions/upload-artifact@v2
with:
name: compendium
path: compendium.tar.gz
# Job to merge translation from current BRANCH to older ones
merge:
if: (github.event_name == 'schedule' && github.repository == 'python/python-docs-pt-br') || (github.event_name != 'schedule')
needs: update
runs-on: ubuntu-latest
strategy:
max-parallel: 4
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH }}
- run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- uses: actions/setup-python@v2
- run: sudo apt update
- run: sudo apt install -y gettext
- name: Run make push
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
make merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Job to build translated documentation treating warnings as errors
build-warn-as-err:
if: (github.event_name == 'schedule' && github.repository == 'python/python-docs-pt-br') || (github.event_name != 'schedule')
needs: update
runs-on: ubuntu-latest
strategy:
max-parallel: 4
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.BRANCH }}
- uses: actions/setup-python@v2
- run: make build CPYTHON_PATH=/tmp/cpython/ 2> >(tee -a build-log.txt >&2)
- name: Update artifact build-output
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: build-output
path: build-log.txt
- uses: appleboy/telegram-action@master
if: ${{ failure() }}
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
args: "❌ Falha na execução do workflow, job *${{ github.job }}* (ID *${{ github.run_id }}*). [Saiba mais sobre o erro...](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"