-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
48 lines (44 loc) · 1.67 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
stages:
- translations
- publish
publish_gem:
image: ruby
stage: publish
script:
- echo "---" > .credentials
- |
echo ":ci_rubygems_api_key: $GEM_HOST_API_KEY" >> .credentials
- chmod 0600 .credentials
- gem build decidim-decidim_geo.gemspec
- gem push decidim-decidim_geo-*.gem -k ci_rubygems_api_key --config-file .credentials
only:
- tags
upload-translations:
stage: translations
image: node:16.18
when: manual
script:
- npm install -g @crowdin/cli
- crowdin upload -T $CROWDIN_PERSONAL_TOKEN -i $CROWDIN_PROJECT_ID --no-progress || exit 1
- crowdin status -T $CROWDIN_PERSONAL_TOKEN -i $CROWDIN_PROJECT_ID --no-progress || exit 1
# Create a MR with the new translation
mr-translations:
stage: translations
image: node:16.18
when: manual
before_script:
- apt-get update && apt-get install -y git
script:
- git config --global user.email "mr-translations"
- git config --global user.name "$GIT_USERNAME"
- npm install -g @crowdin/cli
- crowdin download -T $CROWDIN_PERSONAL_TOKEN -i $CROWDIN_PROJECT_ID --no-progress
- crowdin status -T $CROWDIN_PERSONAL_TOKEN -i $CROWDIN_PROJECT_ID --no-progress || exit 1
- export BRANCH_NAME="i18n/$(date +%Y%m%d%H%M%S)"
- export ORIGIN="crowndin_$(date +%Y%m%d%H%M%S)"
- echo "add $ORIGIN=https://$GIT_USERNAME:[email protected]/$CI_PROJECT_PATH.git"
- git remote add $ORIGIN https://$GIT_USERNAME:[email protected]/$CI_PROJECT_PATH.git
- git checkout -b $BRANCH_NAME
- git add config/locales
- git commit -m "Update translations"
- git push $ORIGIN HEAD:$BRANCH_NAME -o merge_request.create -o merge_request.target=main