2022-05-13 19:35:09 +02:00
|
|
|
pipeline:
|
2022-07-29 14:08:44 +02:00
|
|
|
prepare:
|
|
|
|
image: alpine
|
2022-05-13 19:35:09 +02:00
|
|
|
commands:
|
|
|
|
- cp crowdin.example.yml crowdin.yml
|
|
|
|
- sed -i 's/-removed-/'"$CROWDIN_TOKEN"'/' crowdin.yml
|
|
|
|
secrets: [ CROWDIN_TOKEN ]
|
|
|
|
when:
|
2022-09-12 09:08:47 +02:00
|
|
|
event: [ push, tag, cron ]
|
2022-05-13 19:35:09 +02:00
|
|
|
branch: main
|
2022-07-29 14:08:44 +02:00
|
|
|
|
|
|
|
push:
|
|
|
|
image: crowdin/cli:3.7.8
|
|
|
|
commands:
|
|
|
|
- crowdin push
|
|
|
|
when:
|
|
|
|
event: [ push, tag ]
|
|
|
|
branch: main
|
2022-05-16 18:26:35 +02:00
|
|
|
path: [ app/src/main/res/values/strings.xml, fastlane/metadata/android/en-US/*.txt, fastlane/metadata/android/en-US/changelogs/*.txt ]
|
2022-07-29 14:08:44 +02:00
|
|
|
|
|
|
|
pull:
|
|
|
|
image: crowdin/cli:3.7.8
|
|
|
|
# we do not need to update the config file again since it persists
|
|
|
|
commands:
|
|
|
|
- crowdin pull
|
|
|
|
when:
|
2022-09-12 09:08:47 +02:00
|
|
|
event: [ push, cron ]
|
2022-07-29 14:08:44 +02:00
|
|
|
branch: main
|
|
|
|
|
|
|
|
push-git:
|
|
|
|
image: alpine/git
|
|
|
|
environment:
|
|
|
|
# Information that should be used when authoring a commit
|
|
|
|
- GIT_AUTHOR_NAME=gitnexbot
|
|
|
|
- GIT_AUTHOR_EMAIL=gitnexbot@noreply.codeberg.org
|
|
|
|
- GIT_COMMIT_MESSAGE=Translation updates from Crowdin [CI SKIP]
|
|
|
|
# Basic information concerning the repo that
|
|
|
|
- GITEA_HOST=codeberg.org
|
|
|
|
- GITEA_REPOSITORY=gitnex/GitNex
|
|
|
|
- GITEA_BRANCH=main
|
|
|
|
# Token that should be used to authenticate against the gitea instance
|
|
|
|
# - BOT_TOKEN=secret
|
|
|
|
secrets: [ BOT_TOKEN ]
|
|
|
|
commands:
|
|
|
|
# Setup git credentials and checkout target branch
|
|
|
|
- git config user.name "$${GIT_AUTHOR_NAME}"
|
|
|
|
- git config user.email "$${GIT_AUTHOR_EMAIL}"
|
|
|
|
- git checkout "$${GITEA_BRANCH}"
|
|
|
|
# Stage all important files for commit
|
|
|
|
- git add -A .
|
|
|
|
# If files have changed, create a new commit and push it to the branch this pipeline was started on
|
|
|
|
- >
|
|
|
|
if git commit --message "$${GIT_COMMIT_MESSAGE}"; then
|
|
|
|
git remote set-url origin "https://$${BOT_TOKEN}@$${GITEA_HOST}/$${GITEA_REPOSITORY}"
|
|
|
|
git push origin "$${GITEA_BRANCH}"
|
|
|
|
fi
|
|
|
|
when:
|
|
|
|
branch: main
|
2022-09-12 09:08:47 +02:00
|
|
|
event: [ push, cron ]
|