forked from citymania-org/cmclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
143 lines (129 loc) · 4.26 KB
/
azure-pipelines.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
trigger: none
pr: none
jobs:
- job: source
displayName: 'Source'
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: |
set -e
VERSION=$(cat .version)
echo "${VERSION}"
echo "##vso[build.updatebuildnumber]${VERSION}"
- script: |
set -ex
# Rename the folder to openttd-NNN-source
mkdir openttd-$(Build.BuildNumber)
find . -maxdepth 1 -not -name release_files -not -name .git -not -name . -not -name openttd-$(Build.BuildNumber) -exec mv {} openttd-$(Build.BuildNumber)/ \;
cp -r release_files/* openttd-$(Build.BuildNumber)/
mkdir bundles
tar --xz -cf bundles/openttd-$(Build.BuildNumber)-source.tar.xz openttd-$(Build.BuildNumber)
zip -9 -r -q bundles/citymania-client-$(Build.BuildNumber)-source.zip openttd-$(Build.BuildNumber)
displayName: 'Create bundle'
- task: PublishBuildArtifacts@1
displayName: 'Publish bundles'
inputs:
PathtoPublish: bundles/
ArtifactName: bundles
- job: diff
dependsOn: source
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download source'
inputs:
downloadType: specific
itemPattern: 'bundles/openttd-*-source.tar.xz'
downloadPath: '$(Build.ArtifactStagingDirectory)'
- bash: |
set -e
VERSION=$(cat .version)
echo "##vso[build.updatebuildnumber]${VERSION}"
displayName: 'Change BuildNumber to version'
- bash: |
set -ex
curl -L https://proxy.binaries.openttd.org/openttd-releases/$(Build.BuildNumber)/openttd-$(Build.BuildNumber)-source.tar.xz > vanilla-source.tar.xz
displayName: 'Download vanilla'
- bash: |
set -ex
mkdir vanilla
tar --xz -xf vanilla-source.tar.xz --strip-components=1 -C vanilla
mkdir cmclient
tar --xz -xf ../a/bundles/openttd-*-source.tar.xz --strip-components=1 -C cmclient
displayName: 'Extract sources'
- bash: |
set -ex
mkdir -p bundles
echo "bundles/citymania-client-$(Build.BuildNumber).diff"
diff -r vanilla cmclient -B -X .diff-exclude > bundles/citymania-client-$(Build.BuildNumber).diff || EXIT_CODE=$? && true
if ((EXIT_CODE != 1)); then exit $EXIT_CODE; fi
displayName: 'Make diff'
- task: PublishBuildArtifacts@1
displayName: 'Publish bundles'
inputs:
PathtoPublish: bundles/
ArtifactName: bundles
- job: linux
displayName: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
dependsOn: source
strategy:
matrix:
linux-ubuntu-bionic-amd64-gcc:
Tag: 'linux-ubuntu-bionic-amd64-gcc'
steps:
- template: azure-pipelines/templates/release-fetch-source.yml
- template: azure-pipelines/templates/linux-build.yml
parameters:
Image: compile-farm
ContainerCommand: '$(Build.BuildNumber)'
Tag: $(Tag)
- job: windows
displayName: 'Windows'
pool:
vmImage: 'VS2017-Win2016'
dependsOn: source
strategy:
matrix:
Win32:
BuildPlatform: 'Win32'
BundlePlatform: 'win32'
Win64:
BuildPlatform: 'x64'
BundlePlatform: 'win64'
steps:
- template: azure-pipelines/templates/release-fetch-source.yml
- template: azure-pipelines/templates/windows-dependencies.yml
- template: azure-pipelines/templates/windows-dependency-zip.yml
- template: azure-pipelines/templates/windows-build.yml
parameters:
BuildPlatform: $(BuildPlatform)
BuildConfiguration: Release
- bash: |
set -ex
make -f Makefile.msvc bundle_pdb bundle_zip PLATFORM=$(BundlePlatform) BUNDLE_NAME=citymania-client-$(Build.BuildNumber)-$(BundlePlatform)
displayName: 'Create bundles'
- task: PublishBuildArtifacts@1
displayName: 'Publish bundles'
inputs:
PathtoPublish: bundles/
ArtifactName: bundles
- job: macos
displayName: 'MacOS'
pool:
vmImage: 'macOS-10.14'
dependsOn: source
variables:
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- template: azure-pipelines/templates/release-fetch-source.yml
- template: azure-pipelines/templates/osx-dependencies.yml
- template: azure-pipelines/templates/osx-build.yml
- script: 'make bundle_zip bundle_dmg BUNDLE_NAME=citymania-client-$(Build.BuildNumber)-macosx'
displayName: 'Create bundles'
- task: PublishBuildArtifacts@1
displayName: 'Publish bundles'
inputs:
PathtoPublish: bundles/
ArtifactName: bundles