From 5967096c05a4604cf22903e04dcf49d82996ca53 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 8 Jun 2021 16:57:39 +0200 Subject: [PATCH] add translation stage --- .gitlab-ci.yml | 1 + .gitlab/ci/translation.gitlab-ci.yml | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .gitlab/ci/translation.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 892a8431f..d1cb36b73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ stages: - tests - lint - doc + - translation default: tags: diff --git a/.gitlab/ci/translation.gitlab-ci.yml b/.gitlab/ci/translation.gitlab-ci.yml new file mode 100644 index 000000000..83a9041d7 --- /dev/null +++ b/.gitlab/ci/translation.gitlab-ci.yml @@ -0,0 +1,24 @@ +######################################## +# TRANSLATION +######################################## + +remove-stale-translated-strings: + stage: translation + image: "before-install" + needs: [] + before_script: + - apt-get update -y && apt-get install git hub -y + - git config --global user.email "yunohost@yunohost.org" + - git config --global user.name "$GITHUB_USER" + script: + - cd tests # Maybe move this script location to another folder? + # create a local branch that will overwrite distant one + - git checkout -b "ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}" --no-track + - python remove_stale_translated_strings.py + - '[ $(git diff | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit + - git commit -am "[CI] Remove stale translated strings" || true + - git push -f origin "ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}":"ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}" + - hub pull-request -m "[CI] Remove stale translated strings" -b Yunohost:dev -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd + only: + changes: + - locales/* \ No newline at end of file