weblate-butterflysoup2/.woodpecker.yml
2023-01-26 20:49:12 +01:00

30 lines
1.2 KiB
YAML

pipeline:
build:
image: debian
commands:
- apt-get update
- apt-get install -y git gettext python3 libgl1 zip
- git clone https://lab.encryptionin.space/Queerscriptors/rttk-queerscriptors.git
- git clone https://lab.encryptionin.space/Queerscriptors/renpy.git
- git clone -b game ${CI_REPO_REMOTE} ./game-source
- >
for file in ./translations-*.po; do
file2=$${file%.po}
langcc=$${file2#\.\/translations\-}
if [ $langcc="es_419"]; then langcc="es419";fi
stats=$(msgfmt --statistics $${file} 2>&1)
numdone=$(echo $${stats%* translated*})
echo $stats $numdone
if [ $numdone -le 5680 ]
then
continue
fi
msgfmt "$file" -o game.mo
PATH=$(pwd)/renpy:$${PATH} RENPY_DIR=$(pwd)/renpy python3 rttk-queerscriptors/mo2tl.py $(pwd)/game-source game.mo $${langcc}
zip "$${langcc}.zip" game-source/game/tl/$${langcc}/*
mv "$${langcc}.zip" "/var/www/queer/build/${CI_REPO_NAME}/$${langcc}.zip"
done
volumes:
- /var/www/queer/build/${CI_REPO_NAME}:/var/www/queer/build/${CI_REPO_NAME}