diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 000000000..e90de5b28 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,73 @@ +name: ASF-translations + +on: + schedule: + - cron: '*/10 * * * *' + +jobs: + update: + strategy: + matrix: + os: [ubuntu-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Download latest translations from Crowdin + uses: crowdin/github-action@1.0.9 + with: + upload_sources: false + download_translations: true + skip_untranslated_strings: true + push_translations: false + crowdin_branch_name: master + project_id: ${{ secrets.ASF_CROWDIN_PROJECT_ID }} + token: ${{ secrets.ASF_CROWDIN_API_TOKEN }} + env: + GITHUB_TOKEN: 'not-used' # TODO: https://github.com/crowdin/github-action/pull/30 + + - name: Commit the changes to wiki + shell: sh + run: | + set -eu + + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + cd wiki + + git pull + git add -A "locale" + + if ! git diff --cached --quiet; then + git commit -m "Automatic translations update" + fi + - name: Push changes to wiki + uses: ad-m/github-push-action@master + with: + directory: wiki + github_token: ${{ secrets.GITHUB_TOKEN }} + repository: JustArchiNET/ArchiSteamFarm.wiki + + - name: Commit the changes to ASF + shell: sh + run: | + set -eu + + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + git add -A "ArchiSteamFarm/Localization" "wiki" + + if ! git diff --cached --quiet; then + git commit -m "Automatic translations update" + fi + - name: Push changes to ASF + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }}