Misc
[ArchiSteamFarm.git] / .github / workflows / translations.yml
blob30e23b8b4273efb8d75bfa172bc1f39d5b5d1dc5
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     runs-on: ubuntu-latest
15     steps:
16     - name: Checkout code
17       uses: actions/checkout@v4.1.4
18       with:
19         show-progress: false
20         submodules: recursive
21         token: ${{ secrets.ARCHIBOT_GITHUB_TOKEN }}
23     - name: Reset wiki to follow origin
24       shell: sh
25       working-directory: wiki
26       run: |
27         set -eu
29         git fetch --depth=1 origin master
30         git reset --hard origin/master
32     - name: Download latest translations from Crowdin
33       uses: crowdin/github-action@v1.20.2
34       with:
35         upload_sources: false
36         download_translations: true
37         skip_untranslated_strings: true
38         push_translations: false
39         crowdin_branch_name: main
40         config: '.github/crowdin.yml'
41         project_id: ${{ secrets.ASF_CROWDIN_PROJECT_ID }}
42         token: ${{ secrets.ASF_CROWDIN_API_TOKEN }}
44     - name: Import GPG key for signing
45       uses: crazy-max/ghaction-import-gpg@v6.1.0
46       with:
47         gpg_private_key: ${{ secrets.ARCHIBOT_GPG_PRIVATE_KEY }}
48         git_config_global: true
49         git_user_signingkey: true
50         git_commit_gpgsign: true
52     - name: Commit the changes to wiki
53       shell: sh
54       working-directory: wiki
55       run: |
56         set -eu
58         git add -A "locale"
60         if ! git diff --cached --quiet; then
61             git commit -m "Automatic translations update"
62         fi
64     - name: Push changes to wiki
65       uses: ad-m/github-push-action@v0.8.0
66       with:
67         github_token: ${{ secrets.ARCHIBOT_GITHUB_TOKEN }}
68         branch: master
69         directory: wiki
70         repository: ${{ github.repository }}.wiki
72     - name: Commit the changes to ASF
73       shell: sh
74       run: |
75         set -eu
77         git add -A "ArchiSteamFarm/Localization" "ArchiSteamFarm.OfficialPlugins.ItemsMatcher/Localization" "ArchiSteamFarm.OfficialPlugins.MobileAuthenticator/Localization" "ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/Localization" "wiki"
79         if ! git diff --cached --quiet; then
80             git commit -m "Automatic translations update"
81         fi
83     - name: Push changes to ASF
84       uses: ad-m/github-push-action@v0.8.0
85       with:
86         github_token: ${{ secrets.ARCHIBOT_GITHUB_TOKEN }}
87         branch: ${{ github.ref }}