forked from inveniosoftware/invenio-oaiserver
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 1.96 KB
/
i18n-push.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- coding: utf-8 -*-
#
# Copyright (C) 2022 Graz University of Technology.
#
# Invenio-oaiserver is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
name: i18n:push translations
on: workflow_dispatch # manually trigger
jobs:
i18n-extract:
runs-on: ubuntu-20.04
env:
PYTHON-VERSION: 3.9
steps:
- name: Checkout
uses: actions/checkout@v2
# setup python
- name: Set up Python ${{ env.PYTHON-VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON-VERSION }}
# install dependencies
- name: Install dependencies
run: |
pip install -e ".[all]"
# install transifex client
- name: transifex-client
run: |
pip install transifex-client
# store token
- name: store token
run: |
touch ~/.transifexrc
echo [https://www.transifex.com] >> ~/.transifexrc
echo api_hostname=https://api.transifex.com >> ~/.transifexrc
echo hostname=https://www.transifex.com >> ~/.transifexrc
echo password=${{ secrets.TRANSIFEX_TOKEN }} >> ~/.transifexrc
echo username=api >> ~/.transifexrc
# extract
- name: extract_messages
run: |
python setup.py extract_messages
# push source
- name: push_messages
run: |
tx push -s
# remove transifex credential file
- name: remove transifexrc file
uses: JesseTG/[email protected]
with:
path: ~/.transifexrc
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: i18n:push translations
title: i18n:push translations
body: i18n:push translations
branch: 101-translations-push # name of branch which PR is created from
delete-branch: true # delete branch once merged,closed