mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Work on a GitHub action to auto-update translations on Transifex
This commit is contained in:
parent
fe9653fa13
commit
5afeace988
34
.github/workflows/translations.yml
vendored
Normal file
34
.github/workflows/translations.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
name: Transifex
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, ]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Push-To-Transifex:
|
||||||
|
name: Update translations on Transifex
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@master
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
|
||||||
|
- name: Install calibre dependencies
|
||||||
|
run:
|
||||||
|
python setup/unix-ci.py install
|
||||||
|
|
||||||
|
- name: Install transifex client
|
||||||
|
run:
|
||||||
|
python -m pip install transifex-client
|
||||||
|
|
||||||
|
- name: Update translations
|
||||||
|
env:
|
||||||
|
tx: ${{ secrets.tx }}
|
||||||
|
run:
|
||||||
|
python setup/unix-ci.py pot
|
@ -115,11 +115,24 @@ def main():
|
|||||||
install_env()
|
install_env()
|
||||||
run_python('setup.py bootstrap --ephemeral')
|
run_python('setup.py bootstrap --ephemeral')
|
||||||
|
|
||||||
|
elif action == 'pot':
|
||||||
|
install_env()
|
||||||
|
transifexrc = '''\
|
||||||
|
[https://www.transifex.com]
|
||||||
|
api_hostname = https://api.transifex.com
|
||||||
|
hostname = https://www.transifex.com
|
||||||
|
password = PASSWORD
|
||||||
|
username = api
|
||||||
|
'''.replace('PASSWORD', os.environ['tx'])
|
||||||
|
with open(os.path.expanduser('~/.transifexrc'), 'w') as f:
|
||||||
|
f.write(transifexrc)
|
||||||
|
run_python('setup.py pot')
|
||||||
|
|
||||||
elif action == 'test':
|
elif action == 'test':
|
||||||
os.environ['CI'] = 'true'
|
os.environ['CI'] = 'true'
|
||||||
if ismacos:
|
if ismacos:
|
||||||
os.environ['SSL_CERT_FILE'
|
os.environ['SSL_CERT_FILE'] = os.path.abspath(
|
||||||
] = os.path.abspath('resources/mozilla-ca-certs.pem')
|
'resources/mozilla-ca-certs.pem')
|
||||||
|
|
||||||
install_env()
|
install_env()
|
||||||
run_python('setup.py test')
|
run_python('setup.py test')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user