chore(deps): update crowdin/github-action action to v2.5.1
[ArchiSteamFarm.git] / .github / workflows / translations.yml
bloba44bfdbdf6098bc397e7b7e2f0f0d1c1ae1d844a
1 name: ASF-translations
3 on:
4   schedule:
5   - cron: '55 1 * * *'
6   workflow_dispatch:
8 permissions:
9   contents: write
11 jobs:
12   update:
13     environment: dev-crowdin
14     runs-on: ubuntu-latest
16     steps:
17     - name: Checkout code
18       uses: actions/checkout@v4.2.2
19       with:
20         show-progress: false
21         submodules: recursive
22         token: ${{ secrets.ARCHIBOT_GITHUB_TOKEN }}
24     - name: Reset wiki to follow origin
25       shell: sh
26       working-directory: wiki
27       run: |
28         set -eu
30         git fetch --depth=1 origin master
31         git reset --hard origin/master
33     - name: Download latest translations from Crowdin
34       uses: crowdin/github-action@v2.5.1
35       with:
36         upload_sources: false
37         download_translations: true
38         skip_untranslated_strings: true
39         push_translations: false
40         crowdin_branch_name: main
41         config: '.github/crowdin.yml'
42         project_id: ${{ secrets.ASF_CROWDIN_PROJECT_ID }}
43         token: ${{ secrets.ASF_CROWDIN_API_TOKEN }}
45     - name: Import GPG key for signing
46       uses: crazy-max/ghaction-import-gpg@v6.2.0
47       with:
48         gpg_private_key: ${{ secrets.ARCHIBOT_GPG_PRIVATE_KEY }}
49         git_config_global: true
50         git_user_signingkey: true
51         git_commit_gpgsign: true
53     - name: Commit and push the changes to wiki
54       shell: sh
55       working-directory: wiki
56       run: |
57         set -eu
59         git add -A "locale"
61         if ! git diff --cached --quiet; then
62             git commit -m "Automatic translations update"
64             git push origin HEAD:master
65         fi
67     - name: Commit and push the changes to ASF
68       shell: sh
69       run: |
70         set -eu
72         git add -A "ArchiSteamFarm/Localization" "ArchiSteamFarm.OfficialPlugins.ItemsMatcher/Localization" "ArchiSteamFarm.OfficialPlugins.MobileAuthenticator/Localization" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/Localization" "wiki"
74         if ! git diff --cached --quiet; then
75             git commit -m "Automatic translations update"
77             git push
78         fi