forked from TheWaveWarden/odin2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
259 lines (211 loc) · 9.2 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
trigger:
- master
- devel
- cmake_azure
jobs:
- job: Build
timeoutInMinutes: 120
strategy:
matrix:
Windows:
imageName: 'windows-2019'
isWindows: True
Mac:
imageName: 'macOS-10.15'
isMac: True
Linux:
imageName: 'ubuntu-18.04'
isLinux: True
pool:
vmImage: '$(imageName)'
steps:
- bash: |
git submodule update --init --recursive
displayName: "Git Submodules"
#! ██ ██ ██ ███ ██ ██████ ██████ ██ ██ ███████
#! ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██
#! ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █ ██ ███████
#! ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██
#! ███ ███ ██ ██ ████ ██████ ██████ ███ ███ ███████
- bash: |
nuget install innosetup
displayName: 'Windows: Install Prerequisites'
condition: variables.isWindows
- script: |
mkdir build
cmake -B build -D CMAKE_BUILD_TYPE=Release
displayName: 'Windows: CMake'
condition: variables.isWindows
- script: |
cmake --build build --config Release
displayName: "Windows: Build"
condition: variables.isWindows
- bash: |
iscc installers/windows/win_installer.iss
cd installers/windows/Output
echo ""
echo "Results"
[[ $(find Odin2.exe -type f -size +30000000c 2>/dev/null) ]] && echo "Windows installer built successfully" || exit 1
export PROJ_VERSION=$(cat ../../../CMakeLists.txt | grep "VERSION \"" | awk '{print $2}' | tr -d '"')
echo "Odin Project Version: $PROJ_VERSION"
mv "Odin2.exe" "Odin${PROJ_VERSION}WinInstaller.exe"
ls -la
displayName: 'Windows: Build Installer'
condition: variables.isWindows
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'WINDOWS_BUILD'
targetPath: 'installers/windows/Output'
displayName: 'Windows: Publish Installer'
condition: variables.isWindows
#! ███ ███ █████ ██████
#! ████ ████ ██ ██ ██
#! ██ ████ ██ ███████ ██
#! ██ ██ ██ ██ ██ ██
#! ██ ██ ██ ██ ██████
- script: |
function installdmg {
set -x
tempd=$(mktemp -d)
curl $1 > $tempd/pkg.dmg
listing=$(hdiutil attach $tempd/pkg.dmg | grep Volumes)
volume=$(echo "$listing" | cut -f 3)
if [ -e "$volume"/*.app ]; then
cp -rf "$volume"/*.app /Applications
elif [ -e "$volume"/*.pkg ]; then
package=$(ls -1 "$volume" | grep .pkg | head -1)
sudo installer -verbose -pkg "$volume"/"$package" -target /
fi
sudo hdiutil detach "$(echo "$listing" | cut -f 1)"
rm -rf $tempd
set +x
}
installdmg http://s.sudre.free.fr/Software/files/Packages.dmg
#echo "Download and install Packages packaging tool"
#curl http://s.sudre.free.fr/Software/files/Packages.dmg -o Packages.dmg
#echo "Install Packages packaging tool"
ls -l /usr/local/bin | grep packagesbuild
displayName: 'Mac: Install Prerequisites'
condition: variables.isMac
- script: |
mkdir build
cmake -B build -D CMAKE_BUILD_TYPE=Release -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
find .
displayName: 'Mac: CMake'
condition: variables.isMac
- script: |
cmake --build build --config Release
find .
displayName: "Mac: Build"
condition: variables.isMac
- script: |
cd installers/mac
/usr/local/bin/packagesbuild Odin2MacInstaller.pkgproj
echo ""
echo "The final product:"
ls -lh build
pwd
[[ $(find build/Odin2MacInstaller.pkg -type f -size +50000000c 2>/dev/null) ]] && echo "Mac Package Built Successfully" || exit 1
export PROJ_VERSION=$(cat ../../CMakeLists.txt | grep "VERSION \"" | awk '{print $2}' | tr -d '"')
echo "Odin Project Version: $PROJ_VERSION"
mv "build/Odin2MacInstaller.pkg" "build/Odin${PROJ_VERSION}MacInstaller.pkg"
ls -la build
displayName: 'Mac: Package Odin'
condition: variables.isMac
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'MACOS_BUILD'
targetPath: 'installers/mac/build'
displayName: 'Mac: Publish Installer'
condition: variables.isMac
#! ██ ██ ███ ██ ██ ██ ██ ██
#! ██ ██ ████ ██ ██ ██ ██ ██
#! ██ ██ ██ ██ ██ ██ ██ ███
#! ██ ██ ██ ██ ██ ██ ██ ██ ██
#! ███████ ██ ██ ████ ██████ ██ ██
- script: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0 libwebkit2gtk-4.0-dev libcurl4-openssl-dev alsa alsa-tools libasound2-dev jack libjack-dev libfreetype6-dev libxinerama-dev libxcb-xinerama0 libxinerama1 x11proto-xinerama-dev libxrandr-dev libgl1-mesa-dev libxcursor-dev libxcursor1 libxcb-cursor-dev libxcb-cursor0 xvfb lv2-dev
sudo apt-get install -y --fix-missing
apt list --installed
displayName: 'Linux: Install Prerequisites'
condition: variables.isLinux
- script: |
mkdir build
cmake -B build -D CMAKE_BUILD_TYPE=Release
find .
displayName: 'Linux: CMake'
condition: variables.isLinux
- script: |
cmake --build build --config Release
find .
displayName: "Linux: Build"
condition: variables.isLinux
- script: |
export PROJECT_VERSION=$(cat CMakeLists.txt | grep "VERSION \"" | awk '{print $2}' | tr -d '"')
echo "Odin Project Version: $PROJECT_VERSION"
IFS='.' read -ra ADDR <<< "$PROJECT_VERSION"
export DEBIAN_PROJECT_STRING="${ADDR[0]}.${ADDR[1]}-${ADDR[2]}"
echo "Debian package String: $DEBIAN_PROJECT_STRING"
cd installers/linux
./create_installers.sh $DEBIAN_PROJECT_STRING
ls -lh | grep Odin
export DEB_NAME="Odin2-synth_$DEBIAN_PROJECT_STRING.deb"
echo "Debian name should be: $DEB_NAME"
echo "RESULTS:"
[[ $(find Odin2_linux_x64.zip -type f -size +50000000c 2>/dev/null) ]] && echo "Generic Zip Built sucessfully!" || exit 1
[[ $(find $DEB_NAME -type f -size +50000000c 2>/dev/null) ]] && echo "Debian package built successfully!" || exit 1
echo "Rename Linux Zip"
mkdir build
mv Odin* build/
echo "Odin Project Version: $PROJECT_VERSION"
mv "build/Odin2_linux_x64.zip" "build/Odin${PROJECT_VERSION}Linux.zip"
displayName: 'Linux: Build Odin2 Packages'
condition: variables.isLinux
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'LINUX_BUILD'
targetPath: 'installers/linux/build'
displayName: 'Linux: Publish Installer'
condition: variables.isLinux
#!==============================================================================
#!==============================================================================
#!==============================================================================
#!==============================================================================
#!==============================================================================
#!==============================================================================
#!==============================================================================
- job: NightlyDevelUpdate
pool:
vmImage: 'ubuntu-latest'
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/devel'))
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'MACOS_BUILD'
targetPath: $(Build.ArtifactStagingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'WINDOWS_BUILD'
targetPath: $(Build.ArtifactStagingDirectory)
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'LINUX_BUILD'
targetPath: $(Build.ArtifactStagingDirectory)
- bash: |
scripts/nightly-devel-notes.sh > $(Build.ArtifactStagingDirectory)/ReleaseNotes.md
ls $(Build.ArtifactStagingDirectory)
displayName: Create Release Notes
- task: GitHubRelease@0
displayName: "Create New Github Release"
inputs:
gitHubConnection: TheWaveWardenOdin2AzureConnection
repositoryName: TheWaveWarden/odin2
action: 'edit'
tag: NightlyDevel
target: '$(Build.SourceVersion)'
addChangeLog: false
assetUploadMode: 'delete'
releaseNotesFile: $(Build.ArtifactStagingDirectory)/ReleaseNotes.md
assets: $(Build.ArtifactStagingDirectory)/*.*