Nightly Build #586
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
name: Nightly Build | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch Lokalize CLI | |
run: | | |
wget https://github.com/lokalise/lokalise-cli-2-go/releases/latest/download/lokalise2_linux_x86_64.tar.gz -O $GITHUB_WORKSPACE/lokalise2.tar.gz | |
tar -xvzf $GITHUB_WORKSPACE/lokalise2.tar.gz | |
rm -rf $GITHUB_WORKSPACE/lokalise2.tar.gz | |
chmod +x lokalise2 | |
sudo apt update | |
sudo apt install rename -y | |
- name: Fetch locales from Lokalize | |
run: | | |
./lokalise2 --token ${{ secrets.LOKALISE_TOKEN }} file download --project-id ${{ secrets.LOKALISE_PROJECT }} --format json --export-empty-as base --export-sort a_z --original-filenames=false --unzip-to $GITHUB_WORKSPACE | |
rename -E 'y/A-Z/a-z/' -E 's/_/-/' -- $GITHUB_WORKSPACE/locale/* | |
cp -rf $GITHUB_WORKSPACE/locale/. $GITHUB_WORKSPACE/ | |
rm -rf $GITHUB_WORKSPACE/locale | |
rm -rf $GITHUB_WORKSPACE/lokalise2 | |
- name: Fetch metadata file | |
run: | | |
curl 'https://graph.requarks.io/' -H 'Accept-Encoding: gzip, deflate' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Origin: https://graph.requarks.io' --data-binary '{"query":"{\n localization {\n locales {\n code\n name\n nativeName\n isRTL\n createdAt\n updatedAt\n availability\n }\n }\n}"}' --compressed -o ./locales.json | |
- name: Commit localization files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'Nightly Export' | |
file_pattern: '*.json' | |