You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

52 lines
1.7 KiB

trigger:
branches:
include:
- master
pr: none
stages:
- stage: 'translations'
jobs:
- job: 'Linux'
pool:
vmImage: 'ubuntu-16.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++-9
export CC=gcc-9
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 "Update translation template [skip ci]"
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'))