-
Notifications
You must be signed in to change notification settings - Fork 769
/
translation.yml
52 lines (49 loc) · 1.67 KB
/
translation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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++-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 "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'))