-
Notifications
You must be signed in to change notification settings - Fork 24
/
Jenkinsfile
94 lines (91 loc) · 2.34 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
pipeline {
agent none
stages {
stage('Build') {
parallel {
stage('Build macOS') {
agent {
node {
label 'macos'
}
}
steps {
sh '''
# Setup environment
export PATH="/usr/local/bin:$PATH"
# Build Release
mkdir -p build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DUL_GENERATE_SDK=1
ninja
cd ..
'''
}
post {
success {
deploy();
}
}
}
stage('Build Windows x64') {
agent {
node {
label 'win_x64'
}
}
steps {
bat '''
rem Setup environment
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
set CC=cl.exe
set CXX=cl.exe
rem Build Release
if not exist build mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DUL_GENERATE_SDK=1
ninja
'''
}
post {
success {
deploy();
}
}
}
stage('Build Linux') {
agent {
node {
label 'linux'
}
}
steps {
sh '''
# Build Release
mkdir -p build
cd build
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DUL_GENERATE_SDK=1
ninja
cd ..
'''
}
post {
success {
deploy();
}
}
}
}
}
}
}
def deploy() {
withAWS(endpointUrl:'https://sfo2.digitaloceanspaces.com', credentials:'jenkins-access') {
if (env.BRANCH_NAME == 'master') {
s3Upload(bucket: 'appcore-bin', workingDir:'build', includePathPattern:'*.7z', acl:'PublicRead');
} else if (env.BRANCH_NAME == 'dev') {
s3Upload(bucket: 'appcore-bin-dev', workingDir:'build', includePathPattern:'*.7z', acl:'PublicRead');
}
}
}