-
Notifications
You must be signed in to change notification settings - Fork 50
42 lines (33 loc) · 1.72 KB
/
nightly.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
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'