From ffadbd1551988aed60054115b6ee604034ad131d Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Wed, 15 May 2024 16:55:16 +0200 Subject: [PATCH 1/5] add crowdin action and update workflows --- .../build-warnings.yml} | 3 +- .../greetings4firstIssueOrPullRequest.yml} | 0 .../link-checker.yml} | 0 .github/workflows/tests.yml | 3 ++ .github/workflows/translations.yml | 37 +++++++++++++++++++ 5 files changed, 41 insertions(+), 2 deletions(-) rename .github/workflows/{build-warnings.yml.BACKUP => backup/build-warnings.yml} (96%) rename .github/workflows/{greetings4firstIssueOrPullRequest.yml.BACKUP => backup/greetings4firstIssueOrPullRequest.yml} (100%) rename .github/workflows/{link-checker.yml.BACKUP => backup/link-checker.yml} (100%) create mode 100644 .github/workflows/translations.yml diff --git a/.github/workflows/build-warnings.yml.BACKUP b/.github/workflows/backup/build-warnings.yml similarity index 96% rename from .github/workflows/build-warnings.yml.BACKUP rename to .github/workflows/backup/build-warnings.yml index 6ae6ba603c2d..41a59c38b79c 100644 --- a/.github/workflows/build-warnings.yml.BACKUP +++ b/.github/workflows/backup/build-warnings.yml @@ -4,7 +4,6 @@ on: push: branches: - master - workflow_dispatch: jobs: @@ -47,7 +46,7 @@ jobs: run: | cd ${{ env.DOC_PATH }} sphinx-build -T -E -n -v -w build_log.txt -q -b html -d _build/doctrees . _build/html - + - name: Store build log uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/greetings4firstIssueOrPullRequest.yml.BACKUP b/.github/workflows/backup/greetings4firstIssueOrPullRequest.yml similarity index 100% rename from .github/workflows/greetings4firstIssueOrPullRequest.yml.BACKUP rename to .github/workflows/backup/greetings4firstIssueOrPullRequest.yml diff --git a/.github/workflows/link-checker.yml.BACKUP b/.github/workflows/backup/link-checker.yml similarity index 100% rename from .github/workflows/link-checker.yml.BACKUP rename to .github/workflows/backup/link-checker.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d141834a99eb..261be42993b2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,9 @@ name: Tests on: + push: + branches: + - master workflow_dispatch: jobs: diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 000000000000..0bed9f49ae35 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,37 @@ +name: Update translations + +on: + push: + branches: + - master + schedule: + - cron: '7 0 * * *' # every day at 00:07 UTC + workflow_dispatch: + +env: + CROWDIN_PROJECT_ID: '310610' + +jobs: + synchronize-with-crowdin: + runs-on: ubuntu-latest + if: github.repository == 'openaps/AndroidAPSdocs' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: crowdin action + uses: crowdin/github-action@v1 + with: + upload_sources: true + upload_translations: false + download_translations: true + localization_branch_name: l10n_translations + create_pull_request: true + pull_request_title: 'New translations' + pull_request_body: 'New translations' + pull_request_base_branch_name: 'main' + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + CROWDIN_PROJECT_ID: ${{ env.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file From 79e55ed4b3c31b70fbafa8b3ff27450f3941aa2d Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Wed, 15 May 2024 17:01:46 +0200 Subject: [PATCH 2/5] fix config --- .github/workflows/translations.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 0bed9f49ae35..55e6b01b857a 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -33,5 +33,4 @@ jobs: pull_request_base_branch_name: 'main' env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - CROWDIN_PROJECT_ID: ${{ env.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file From 75ed7fd98d05af12f7cf74e9181cf68cfceae6c6 Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Wed, 15 May 2024 17:05:18 +0200 Subject: [PATCH 3/5] adjust config --- .github/workflows/translations.yml | 3 --- crowdin.yml | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 55e6b01b857a..2539aa3e3fe4 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -8,9 +8,6 @@ on: - cron: '7 0 * * *' # every day at 00:07 UTC workflow_dispatch: -env: - CROWDIN_PROJECT_ID: '310610' - jobs: synchronize-with-crowdin: runs-on: ubuntu-latest diff --git a/crowdin.yml b/crowdin.yml index 64fc581ab29e..5057cf57350f 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,7 +1,12 @@ +project_id: '310610' +project_id_env: CROWDIN_PROJECT_ID +api_token_env: CROWDIN_PERSONAL_TOKEN +preserve_hierarchy: true + files: - source: /docs/EN/**/*.md - translation: /docs/CROWDIN/%two_letters_code%/**/%original_file_name% + translation: /docs/CROWDIN/%two_letters_code%/%original_path%/%original_file_name% - source: /docs/EN/**/*.rst - translation: /docs/CROWDIN/%two_letters_code%/**/%original_file_name% + translation: /docs/CROWDIN/%two_letters_code%/%original_path%/%original_file_name% - source: /docs/EN/images/**/* - translation: /docs/CROWDIN/%two_letters_code%/images/**/%original_file_name% + translation: /docs/CROWDIN/%two_letters_code%/images/%original_path%/%original_file_name% From 27317b34a397a1e10f68da9b12911bf938bee980 Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Wed, 15 May 2024 17:06:56 +0200 Subject: [PATCH 4/5] add permissions --- .github/workflows/translations.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 2539aa3e3fe4..3c3c6398a84e 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -12,6 +12,9 @@ jobs: synchronize-with-crowdin: runs-on: ubuntu-latest if: github.repository == 'openaps/AndroidAPSdocs' + permissions: + contents: write + pull-requests: write steps: - name: Checkout @@ -29,5 +32,5 @@ jobs: pull_request_body: 'New translations' pull_request_base_branch_name: 'main' env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file From 794f662708def850414926391bf8ff1c65d8817f Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Wed, 15 May 2024 17:15:05 +0200 Subject: [PATCH 5/5] remove unused option --- crowdin.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/crowdin.yml b/crowdin.yml index 5057cf57350f..9abd15347c3d 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,5 +1,4 @@ project_id: '310610' -project_id_env: CROWDIN_PROJECT_ID api_token_env: CROWDIN_PERSONAL_TOKEN preserve_hierarchy: true