-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github action of transifex upload
- Loading branch information
Showing
2 changed files
with
51 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: release | ||
|
||
# on: | ||
# release: | ||
# types: [published, edited] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
upload-transifex: | ||
# Every time when a new version is released, | ||
# upload the latest pot files to transifex services for team transilation. | ||
# https://www.transifex.com/aiidateam/aiida-core/dashboard/ | ||
|
||
name: Upload pot files to transifex | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
# Build doc to pot files and register them to `.tx/config` file | ||
# Installation steps are modeled after the docs job in `ci.yml` | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install python dependencies | ||
run: | | ||
pip install numpy==1.17.4 | ||
pip install transifex-client sphinx-intl | ||
pip install -e .[docs,testing] | ||
- name: Build pot files | ||
env: | ||
READTHEDOCS: 'True' | ||
RUN_APIDOC: 'False' | ||
run: | ||
sphinx-build -b gettext docs/source locale | ||
|
||
- name: Setting transifex configuration and upload pot files | ||
env: | ||
PROJECT_NAME: 'aiida-core' | ||
USER: ${{ secrets.TRANSIFEX_USER }} | ||
PASSWD: ${{ secrets.TRANSIFEX_PASSWORD }} | ||
run: | | ||
tx init --no-interactive | ||
sphinx-intl update-txconfig-resources --pot-dir locale --transifex-project-name ${PROJECT_NAME} | ||
echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = '"${USER}"$'\npassword = '"${PASSWD}"$'\n' > ~/.transifexrc | ||
tx push -s |