2023-09-19 13:23:43 +08:00
|
|
|
steps:
|
2022-07-29 20:08:44 +08:00
|
|
|
prepare:
|
|
|
|
image: alpine
|
2022-05-14 01:35:09 +08:00
|
|
|
commands:
|
|
|
|
- cp crowdin.example.yml crowdin.yml
|
|
|
|
- sed -i 's/-removed-/'"$CROWDIN_TOKEN"'/' crowdin.yml
|
|
|
|
secrets: [ CROWDIN_TOKEN ]
|
|
|
|
when:
|
2022-09-12 15:08:47 +08:00
|
|
|
event: [ push, tag, cron ]
|
2022-05-14 01:35:09 +08:00
|
|
|
branch: main
|
2022-07-29 20:08:44 +08:00
|
|
|
|
|
|
|
push:
|
2024-03-18 13:12:24 +08:00
|
|
|
image: crowdin/cli:3.16.0
|
2022-07-29 20:08:44 +08:00
|
|
|
commands:
|
|
|
|
- crowdin push
|
|
|
|
when:
|
|
|
|
event: [ push, tag ]
|
|
|
|
branch: main
|
2022-05-17 00:26:35 +08: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 20:08:44 +08:00
|
|
|
|
|
|
|
pull:
|
2024-03-18 13:12:24 +08:00
|
|
|
image: crowdin/cli:3.16.0
|
2022-07-29 20:08:44 +08:00
|
|
|
# we do not need to update the config file again since it persists
|
|
|
|
commands:
|
|
|
|
- crowdin pull
|
|
|
|
when:
|
2022-09-12 15:08:47 +08:00
|
|
|
event: [ push, cron ]
|
2022-07-29 20:08:44 +08: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 15:08:47 +08:00
|
|
|
event: [ push, cron ]
|