-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
136 lines (130 loc) · 6.3 KB
/
Jenkinsfile
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
pipeline {
agent none
options {
checkoutToSubdirectory('saisgpl')
disableConcurrentBuilds()
}
stages {
stage('build') {
parallel {
stage('linux64') {
agent {
label 'linux'
}
steps {
dir('saisgpl.l64') {
deleteDir()
}
cmakeBuild generator: 'Ninja',
buildDir: 'saisgpl.l64',
sourceDir: 'saisgpl',
buildType: 'Release',
installation: 'CMake 3.16.0',
steps: [
[args: 'all']
]
dir('saisgpl.l64') {
cpack installation: 'CMake 3.16.0'
archiveArtifacts artifacts: 'SAIS-GPL-**', defaultExcludes: false, fingerprint: true
}
}
}
stage('macos64') {
agent {
label 'macos'
}
steps {
sh '''
export PATH=/usr/local/bin:$PATH
conan config install "${WORKSPACE}/saisgpl/conan"
'''
dir('saisgpl.m64') {
deleteDir()
sh '''
export PATH=/usr/local/bin:$PATH
export MACOS_DEPLOYMENT_TARGET=10.11
conan install ../saisgpl --build --update --profile=release-m64
'''
}
cmakeBuild buildDir: 'saisgpl.m64',
sourceDir: 'saisgpl',
cmakeArgs: "-DUSE_CONAN=ON",
buildType: 'Release',
installation: 'CMake 3.16.0',
steps: [
[args: 'all']
]
dir('saisgpl.m64') {
sh '''
set +x
security unlock-keychain -p "${APPSIGNING_PASSWORD}" appsigning
codesign --keychain appsigning -s "${APPSIGNING_KEYID}" --options runtime,library --timestamp "bin/Strange Adventures in Infinite Space.app"
'''
cpack installation: 'CMake 3.16.0',
arguments: '-G ZIP'
sh '''
set +x
PATH=/usr/local/bin:"${PATH}"
export PATH
xcrun altool --notarize-app --primary-bundle-id "au.com.ecsim.SAISGPL" --username "${APPSIGNING_APPLEUSER}" --password "${APPSIGNING_APPLEPW}" --file SAIS-GPL-*-macOS-x86_64.zip --output-format xml | tee notarization-submission.plist
plutil -convert json notarization-submission.plist
REQUEST_ID="$(jq '."notarization-upload".RequestUUID' -r notarization-submission.plist)"
echo "Notarization Request ID: ${REQUEST_ID}"
NOTARIZATION_STATUS=""
update_status () {
xcrun altool --notarization-info "${REQUEST_ID}" --username "${APPSIGNING_APPLEUSER}" --password "${APPSIGNING_APPLEPW}" --output-format=xml > notarization-result.plist
plutil -remove 'notarization-info.Date' notarization-result.plist
plutil -convert json notarization-result.plist
NOTARIZATION_STATUS="$(jq '."notarization-info".Status' -r notarization-result.plist)"
}
update_status
echo "NOTARIZATION_STATUS is ${NOTARIZATION_STATUS}"
while [ "${NOTARIZATION_STATUS}" = "in progress" ]; do
sleep 60
update_status
echo "NOTARIZATION_STATUS is ${NOTARIZATION_STATUS}"
done
if [ "${NOTARIZATION_STATUS}" != "success" ]; then
echo "Notarization failed."
exit 1
fi
xcrun stapler staple -v "bin/Strange Adventures in Infinite Space.app"
'''
cpack installation: 'CMake 3.16.0'
archiveArtifacts artifacts: 'SAIS-GPL-**', defaultExcludes: false, fingerprint: true
}
}
}
stage('win64') {
agent {
label 'windows'
}
steps {
bat '''
conan config install %WORKSPACE%\\saisgpl\\conan
'''
dir('saisgpl.w64') {
deleteDir()
bat '''
conan install ..\\saisgpl --build=outdated --build=cascade --update --profile=release-w64
'''
}
cmakeBuild generator: 'Visual Studio 16 2019',
sourceDir: 'saisgpl',
buildDir: 'saisgpl.w64',
cmakeArgs: "-DUSE_CONAN=ON",
buildType: 'Release',
installation: 'CMake 3.16.0',
steps: [
[args: '-- -p:Configuration=Release', withCmake: true]
]
dir('saisgpl.w64') {
cpack installation: 'CMake 3.16.0'
archiveArtifacts artifacts: 'SAIS-GPL-**', defaultExcludes: false, fingerprint: true
}
}
}
}
}
}
}