inkstitch/.github/workflows/translations.yml

61 wiersze
2.2 KiB
YAML
Czysty Zwykły widok Historia

2020-03-08 03:50:12 +00:00
name: Translations
on:
schedule:
- cron: '0 0 * * *'
jobs:
crowdin:
2021-03-05 16:19:25 +00:00
runs-on: ubuntu-20.04
2020-03-08 03:50:12 +00:00
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
2020-08-19 00:53:46 +00:00
ref: main
2020-03-08 03:50:12 +00:00
token: ${{secrets.INKSTITCH_BUILDS_GITHUB_TOKEN}}
- name: checkout submodules
run: |
git submodule update --init --recursive
- uses: actions/setup-python@v1
with:
2021-03-05 16:19:25 +00:00
python-version: '3.x'
2020-03-08 03:50:12 +00:00
- env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
run: |
git config --global user.email "inkstitch-crowdin@lex.gd"
git config --global user.name "Ink/Stitch Crowdin integration"
wget --quiet https://downloads.crowdin.com/cli/v2/crowdin-cli.zip
unzip -j crowdin-cli.zip
2021-10-15 06:12:23 +00:00
sudo apt-get update
2021-10-12 06:37:43 +00:00
sudo apt install gettext
# for wxPython
sudo apt install glib-networking libsdl1.2-dev
2021-10-12 06:55:04 +00:00
# for PyGObject
sudo apt install libgirepository1.0-dev libcairo2-dev
2021-10-12 06:37:43 +00:00
# for shapely
sudo apt install libgeos-dev build-essential libgtk-3-dev
2020-03-08 03:50:12 +00:00
python -m pip install --upgrade pip
2021-10-12 06:37:43 +00:00
python -m pip install wheel
2021-10-12 06:55:04 +00:00
python -m pip install pycairo==1.11.1
python -m pip install PyGObject==3.30.5
2021-10-10 07:31:35 +00:00
python -m pip install -r requirements.txt
python -m pip install Babel
2020-03-08 03:50:12 +00:00
make messages.po
echo "uploading messages.po to crowdin"
2020-08-19 00:53:46 +00:00
java -jar crowdin-cli.jar -v upload -b main
2020-03-08 03:50:12 +00:00
echo "downloading new translations"
2020-08-19 00:53:46 +00:00
java -jar crowdin-cli.jar -v pull -b main
2020-03-08 03:50:12 +00:00
# Try to only commit if translations changed. Crowdin will update all
# files when a new translation string is added but we don't need to
# commit those until folks actually translate the new strings.
if git diff translations | grep -qE '^[-+]msgstr ".+"$'; then
2021-03-05 16:19:25 +00:00
make electron/src/renderer/assets/translations.json
git add translations electron/src/renderer/assets/translations.json
2020-03-08 03:50:12 +00:00
git commit -m "new translations from Crowdin"
2020-08-19 00:53:46 +00:00
git push https://github.com/inkstitch/inkstitch main
2020-03-08 03:50:12 +00:00
fi