GitNex/.woodpecker/locale.yml
qwerty287 6a84e4d897 Extend CI workflows (#1155)
Extend CI workflows (-> https://codeberg.org/gitnex/GitNex/issues/1099)
	1. pull translations and push them again on every pull
       @mmarif this needs the secrets and `BOT_TOKEN`
       the code for this comes from tea4j-autodeploy
    2. add a **template** for a check workflow which only does some static checks right now. It is disabled because it requires some investigation and discussion on how we should deal with these issues. The checks are currently (if we would enable it):
    	1. check code style and formatting according to the project file in `.idea/`
        2. make sure every Java file has an `@author` annotation

I would wait until you reviewed with enabling them because we have to reformat all the files which results in changes with a few thousand changed lines (tried this once).

Closes https://codeberg.org/gitnex/GitNex/issues/141

Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1155
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
2022-07-29 14:08:44 +02:00

60 lines
1.9 KiB
YAML

pipeline:
prepare:
image: alpine
commands:
- cp crowdin.example.yml crowdin.yml
- sed -i 's/-removed-/'"$CROWDIN_TOKEN"'/' crowdin.yml
secrets: [ CROWDIN_TOKEN ]
when:
event: [ push, tag ]
branch: main
push:
image: crowdin/cli:3.7.8
commands:
- crowdin push
when:
event: [ push, tag ]
branch: main
path: [ app/src/main/res/values/strings.xml, fastlane/metadata/android/en-US/*.txt, fastlane/metadata/android/en-US/changelogs/*.txt ]
pull:
image: crowdin/cli:3.7.8
# we do not need to update the config file again since it persists
commands:
- crowdin pull
when:
event: [ push, tag ]
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
event: [ push, tag ]