-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
186 lines (160 loc) · 8.35 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
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
pipeline {
agent any
environment {
NAME = 'OneWorld'
BASE_NAME = 'oneworld'
ZIP_NAME = 'OWO'
}
stages {
stage("depends") {
steps {
echo 'building depends ...'
sh '''#!/bin/bash
cd depends
make -j $(nproc) HOST=x86_64-pc-linux-gnu
make -j $(nproc) HOST=x86_64-w64-mingw32
make -j $(nproc) HOST=aarch64-linux-gnu
make -j $(nproc) HOST=arm-linux-gnueabihf
rm -rf SDKs
mkdir SDKs
cd SDKs
wget -c https://ipfs.decenomy.net/QmccbpJcugkoV6uVovYsyZ3MPxGTcbUNYXMhLQL2hLzHwH -O MacOSX10.11.sdk.tar.xz
tar -xf MacOSX10.11.sdk.tar.xz
cd ..
make -j $(nproc) HOST=x86_64-apple-darwin14
'''
}
}
stage("build_x86_64-pc-linux-gnu") {
steps {
echo 'building linux ...'
sh '''#!/bin/bash
make clean
./autogen.sh
./configure --enable-glibc-back-compat --prefix=$(pwd)/depends/x86_64-pc-linux-gnu LDFLAGS="-static-libstdc++" --enable-cxx --enable-static --disable-shared --disable-debug --disable-tests --disable-bench --with-pic --enable-upnp-default CPPFLAGS="-fPIC -O3" CXXFLAGS="-fPIC -O3"
make -j $(nproc) HOST=x86_64-pc-linux-gnu
'''
}
}
stage("deploy_x86_64-pc-linux-gnu") {
steps {
echo 'deploy linux ...'
sh """#!/bin/bash
mkdir -p deploy/linux
strip -s src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt
cp src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt deploy/linux/
cd deploy/linux
touch ${BASE_NAME}-cli
rm ../${BASE_NAME}-cli
cp ${BASE_NAME}-cli ../
zip ${ZIP_NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-Linux.zip ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt
rm -f ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt
"""
}
}
stage("build_x86_64-w64-mingw32") {
steps {
echo 'building windows ...'
sh '''#!/bin/bash
make clean
./autogen.sh
./configure --prefix=$(pwd)/depends/x86_64-w64-mingw32 --disable-debug --disable-tests --disable-bench --enable-upnp-default CFLAGS="-O3" CXXFLAGS="-O3"
make -j $(nproc) HOST=x86_64-w64-mingw32
'''
}
}
stage("deploy_x86_64-w64-mingw32") {
steps {
echo 'deploy windows ...'
sh """#!/bin/bash
mkdir -p deploy/windows
strip -s src/${BASE_NAME}d.exe src/${BASE_NAME}-cli.exe src/${BASE_NAME}-tx.exe src/qt/${BASE_NAME}-qt.exe
cp src/${BASE_NAME}d.exe src/${BASE_NAME}-cli.exe src/${BASE_NAME}-tx.exe src/qt/${BASE_NAME}-qt.exe deploy/windows/
cd deploy/windows
zip ${ZIP_NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-Windows.zip ${BASE_NAME}d.exe ${BASE_NAME}-cli.exe ${BASE_NAME}-tx.exe ${BASE_NAME}-qt.exe
mkdir -p ../../contrib/innosetup/package
mv ${BASE_NAME}* ../../contrib/innosetup/package/
cd ../../contrib/innosetup/
wine ~/.wine/drive_c/Program\\ Files\\ \\(x86\\)/Inno\\ Setup\\ 6/ISCC.exe setup.iss
mv output/${NAME}Setup.exe ../../deploy/windows/${NAME}-\$(../../deploy/${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-Setup.exe
cd ../../deploy/windows/
zip ${ZIP_NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-WindowsSetup.zip ${NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-Setup.exe
rm -f ${NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-Setup.exe
"""
}
}
stage("build_x86_64-apple-darwin14") {
steps {
echo 'building macos ...'
sh '''#!/bin/bash
make clean
./autogen.sh
./configure --prefix=$(pwd)/depends/x86_64-apple-darwin14 --enable-cxx --enable-static --disable-shared --disable-debug --disable-tests --disable-bench --enable-upnp-default
make -j $(nproc) HOST=x86_64-apple-darwin14
'''
}
}
stage("deploy_x86_64-apple-darwin14") {
steps {
echo 'deploy macos ...'
sh """#!/bin/bash
strip -s src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt
make deploy HOST=x86_64-apple-darwin14
mkdir -p deploy/macos
cp src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt ${NAME}-Core.dmg deploy/macos/
cd deploy/macos
zip ${ZIP_NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-MacOS.zip ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt ${NAME}-Core.dmg
rm -f ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt ${NAME}-Core.dmg
"""
}
}
stage("build_aarch64-linux-gnu") {
steps {
echo 'building aarch64 ...'
sh '''#!/bin/bash
make clean
./autogen.sh
./configure --prefix=$(pwd)/depends/aarch64-linux-gnu --disable-debug --disable-tests --disable-bench --enable-upnp-default CFLAGS="-O3" CXXFLAGS="-O3"
make -j $(nproc) HOST=aarch64-linux-gnu
'''
}
}
stage("deploy_aarch64-linux-gnu") {
steps {
echo 'deploy aarch64 ...'
sh """#!/bin/bash
mkdir -p deploy/aarch64
strip -s src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt
cp src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt deploy/aarch64/
cd deploy/aarch64
zip ${ZIP_NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-aarch64.zip ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt
rm -f ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt
"""
}
}
stage("build_arm-linux-gnueabihf") {
steps {
echo 'building aarch32 ...'
sh '''#!/bin/bash
make clean
./autogen.sh
./configure --prefix=$(pwd)/depends/arm-linux-gnueabihf --disable-debug --disable-tests --disable-bench --enable-upnp-default CFLAGS="-O3" CXXFLAGS="-O3"
make -j $(nproc) HOST=arm-linux-gnueabihf
'''
}
}
stage("deploy_arm-linux-gnueabihf") {
steps {
echo 'deploy aarch32 ...'
sh """#!/bin/bash
mkdir -p deploy/aarch32
strip -s src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt
cp src/${BASE_NAME}d src/${BASE_NAME}-cli src/${BASE_NAME}-tx src/qt/${BASE_NAME}-qt deploy/aarch32/
cd deploy/aarch32
zip ${ZIP_NAME}-\$(../${BASE_NAME}-cli --version | head -n1 | awk -F'[ -]' '{ print \$5 }' | sed s/v//)-aarch32.zip ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt
rm -f ${BASE_NAME}d ${BASE_NAME}-cli ${BASE_NAME}-tx ${BASE_NAME}-qt
"""
}
}
}
}