trigger: branches: include: - master pr: none stages: - stage: 'translations' jobs: - job: 'Linux' pool: vmImage: 'ubuntu-18.04' displayName: 'Update translation template' steps: - bash: | git config --local user.name "Azure Pipelines" git config --local user.email "azuredevops@microsoft.com" displayName: 'Setup git' - template: steps/install_deps_ubuntu.yml - bash: | git checkout master mkdir build displayName: 'Create build directory' - bash: | export CXX=g++-8 export CC=gcc-8 cmake .. cmake --build . --target pot workingDirectory: ./build displayName: 'Build Xournal++ translation template' - task: DownloadSecureFile@1 inputs: secureFile: deploy_key displayName: 'Get the deploy key' - bash: | if [[ $(git diff --word-diff=porcelain --no-color -U0 | wc -l) -gt 9 ]]; then git commit -am "[skip ci] Update translation template" mkdir ~/.ssh && mv $DOWNLOADSECUREFILE_SECUREFILEPATH ~/.ssh/id_rsa chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts git remote set-url --push origin git@github.com:xournalpp/xournalpp.git git push origin HEAD:master echo "Translation template successfully updated." else echo "Translation template is already up to date." fi workingDirectory: ./build displayName: 'Push new translation template' condition: | and(not(eq(variables['Build.Reason'], 'PullRequest')), eq(variables['Build.SourceBranch'], 'refs/heads/master'))