-
Notifications
You must be signed in to change notification settings - Fork 36
/
Jenkinsfile
114 lines (110 loc) · 3.1 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
pipeline {
agent none
stages {
stage('Build') {
parallel {
stage('Build macOS') {
agent {
node {
label 'macos'
}
}
steps {
sh '''
# Setup environment
export PATH="/usr/local/bin:$PATH"
# Get dependencies (we force it on macOS/Linux because of CMake/Ninja issue)
mkdir -p build_deps
cd build_deps
cmake ../Source/GetDeps -G "Ninja"
ninja
cd ..
'''
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 -DUL_ENABLE_VIDEO=0
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 -DUWP_PLATFORM=0 -DWINDOWS_DESKTOP_PLATFORM=1 -DUL_GENERATE_SDK=1 -DUL_ENABLE_VIDEO=0
ninja
cd ..
'''
}
post {
success {
deploy();
}
}
}
stage('Build Linux') {
agent {
node {
label 'linux'
}
}
steps {
sh '''
# Get dependencies (we force it on macOS/Linux because of CMake/Ninja issue)
mkdir -p build_deps
cd build_deps
cmake ../Source/GetDeps -G "Ninja"
ninja
cd ..
'''
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 -DUL_ENABLE_VIDEO=0
ninja
cd ..
'''
}
post {
success {
deploy();
}
}
}
}
}
}
}
def deploy() {
withAWS(endpointUrl:'https://sfo2.digitaloceanspaces.com', credentials:'jenkins-access') {
if (env.BRANCH_NAME == 'master') {
s3Upload(bucket: 'webcore-bin', workingDir:'build', includePathPattern:'*.7z', acl:'PublicRead');
} else if (env.BRANCH_NAME == 'dev') {
s3Upload(bucket: 'webcore-bin-dev', workingDir:'build', includePathPattern:'*.7z', acl:'PublicRead');
}
}
}