1
1
common = load ' ci/common.groovy'
2
2
3
- qtBin = ' /opt/qt59/bin'
4
3
packageFolder = ' ./StatusImPackage'
5
- external_modules_dir = [
6
- ' node_modules/react-native-i18n/desktop' ,
7
- ' node_modules/react-native-config/desktop' ,
8
- ' node_modules/react-native-fs/desktop' ,
9
- ' node_modules/react-native-http-bridge/desktop' ,
10
- ' node_modules/react-native-webview-bridge/desktop' ,
11
- ' node_modules/react-native-keychain/desktop' ,
12
- ' node_modules/react-native-securerandom/desktop' ,
13
- ' modules/react-native-status/desktop' ,
14
- ' node_modules/google-breakpad' ,
15
- ]
16
-
17
- external_fonts = [
18
- ' ../../../../../resources/fonts/SF-Pro-Text-Regular.otf' ,
19
- ' ../../../../../resources/fonts/SF-Pro-Text-Medium.otf' ,
20
- ' ../../../../../resources/fonts/SF-Pro-Text-Light.otf' ,
21
- ]
22
4
23
5
def cleanupBuild () {
24
- sh """
25
- rm -rf ${ packageFolder}
26
- """
27
6
sh ' make clean'
28
7
}
29
8
@@ -43,16 +22,8 @@ def slackNotify(message, color = 'good') {
43
22
}
44
23
45
24
def buildClojureScript () {
46
- sh ' rm -f index.desktop.js'
47
- sh ' lein prod-build-desktop'
48
- sh " mkdir ${ packageFolder} "
49
- sh """
50
- react-native bundle \\
51
- --entry-file index.desktop.js \\
52
- --dev false --platform desktop \\
53
- --bundle-output ${ packageFolder} /StatusIm.jsbundle \\
54
- --assets-dest ${ packageFolder} /assets
55
- """
25
+ sh ' make prod-build-desktop'
26
+ sh ' ./scripts/build-desktop.sh buildClojureScript'
56
27
}
57
28
58
29
def uploadArtifact (filename ) {
@@ -85,121 +56,25 @@ def prepDeps() {
85
56
cleanupAndDeps()
86
57
}
87
58
88
- def compileLinux () {
89
- dir(' desktop' ) {
90
- sh ' rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile'
91
- sh """
92
- cmake -Wno-dev \\
93
- -DCMAKE_BUILD_TYPE=Release \\
94
- -DEXTERNAL_MODULES_DIR='${ external_modules_dir.join(";")} ' \\
95
- -DDESKTOP_FONTS='${ external_fonts.join(";")} ' \\
96
- -DJS_BUNDLE_PATH='${ workspace} /${ packageFolder} /StatusIm.jsbundle' \\
97
- -DCMAKE_CXX_FLAGS:='-DBUILD_FOR_BUNDLE=1'
98
- """
99
- sh ' make'
100
- }
59
+ def compile () {
60
+ sh ' ./scripts/build-desktop.sh compile'
101
61
}
102
62
103
63
def bundleLinux (type = ' nightly' ) {
104
64
def pkg
105
65
66
+ sh ' ./scripts/build-desktop.sh bundle'
106
67
dir(packageFolder) {
107
- sh ' rm -rf StatusImAppImage'
108
- /* TODO this needs to be fixed: status-react/issues/5378 */
109
- sh ' cp /opt/StatusImAppImage.zip ./'
110
- sh ' unzip ./StatusImAppImage.zip'
111
- sh ' rm -rf AppDir'
112
- sh ' mkdir AppDir'
113
- }
114
- sh " cp -r ./deployment/linux/usr ${ packageFolder} /AppDir"
115
- sh " cp ./deployment/env ${ packageFolder} /AppDir/usr/bin"
116
- sh " cp ./desktop/bin/StatusIm ${ packageFolder} /AppDir/usr/bin"
117
- sh " cp ./desktop/reportApp/reportApp ${ packageFolder} /AppDir/usr/bin"
118
- sh ' wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage'
119
- sh ' chmod a+x ./linuxdeployqt-continuous-x86_64.AppImage'
120
-
121
- sh ' rm -f Application-x86_64.AppImage'
122
- sh ' rm -f StatusIm-x86_64.AppImage'
123
-
124
- sh " ldd ${ packageFolder} /AppDir/usr/bin/StatusIm"
125
- sh """
126
- ./linuxdeployqt-continuous-x86_64.AppImage \\
127
- ${ packageFolder} /AppDir/usr/bin/reportApp \\
128
- -verbose=3 -always-overwrite -no-strip -no-translations -qmake=${ qtBin} /qmake \\
129
- -qmldir='${ workspace} /desktop/reportApp'
130
- """
131
- sh """
132
- ./linuxdeployqt-continuous-x86_64.AppImage \\
133
- ${ packageFolder} /AppDir/usr/share/applications/StatusIm.desktop \\
134
- -verbose=3 -always-overwrite -no-strip \\
135
- -no-translations -bundle-non-qt-libs \\
136
- -qmake=${ qtBin} /qmake \\
137
- -extra-plugins=imageformats/libqsvg.so \\
138
- -qmldir='${ workspace} /node_modules/react-native'
139
- """
140
- dir(packageFolder) {
141
- sh ' ldd AppDir/usr/bin/StatusIm'
142
- sh ' cp -r assets/share/assets AppDir/usr/bin'
143
- sh ' cp -rf StatusImAppImage/* AppDir/usr/bin'
144
- sh ' rm -f AppDir/usr/bin/StatusIm.AppImage'
145
- }
146
- sh """
147
- ./linuxdeployqt-continuous-x86_64.AppImage \\
148
- ${ packageFolder} /AppDir/usr/share/applications/StatusIm.desktop \\
149
- -verbose=3 -appimage -qmake=${ qtBin} /qmake
150
- """
151
- dir(packageFolder) {
152
- sh ' ldd AppDir/usr/bin/StatusIm'
153
- sh ' rm -rf StatusIm.AppImage'
154
68
pkg = common. pkgFilename(type, ' AppImage' )
155
69
sh " mv ../StatusIm-x86_64.AppImage ${ pkg} "
156
70
}
157
71
return " ${ packageFolder} /${ pkg} " . drop(2 )
158
72
}
159
73
160
- def compileMacOS () {
161
- /* add path for QT installation binaries */
162
- env. PATH = " /Users/administrator/qt/5.9.1/clang_64/bin:${ env.PATH} "
163
- dir(' desktop' ) {
164
- sh ' rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile'
165
- sh """
166
- cmake -Wno-dev \\
167
- -DCMAKE_BUILD_TYPE=Release \\
168
- -DEXTERNAL_MODULES_DIR='${ external_modules_dir.join(";")} ' \\
169
- -DDESKTOP_FONTS='${ external_fonts.join(";")} ' \\
170
- -DJS_BUNDLE_PATH='${ workspace} /${ packageFolder} /StatusIm.jsbundle' \\
171
- -DCMAKE_CXX_FLAGS:='-DBUILD_FOR_BUNDLE=1'
172
- """
173
- sh ' make'
174
- }
175
- }
176
-
177
74
def bundleMacOS (type = ' nightly' ) {
178
75
def pkg = common. pkgFilename(type, ' dmg' )
76
+ sh ' ./scripts/build-desktop.sh bundle'
179
77
dir(packageFolder) {
180
- sh ' curl -L -O "https://github.com/status-im/StatusAppFiles/raw/PR5702/Status.app.zip"'
181
- sh ' unzip Status.app.zip'
182
- sh ' cp -r assets/share/assets Status.app/Contents/Resources'
183
- sh ' ln -sf ../Resources/assets ../Resources/ubuntu-server ../Resources/node_modules ' +
184
- ' Status.app/Contents/MacOS'
185
- sh ' chmod +x Status.app/Contents/Resources/ubuntu-server'
186
- sh ' cp ../desktop/bin/StatusIm Status.app/Contents/MacOS/Status'
187
- sh ' cp ../desktop/reportApp/reportApp Status.app/Contents/MacOS'
188
- sh " cp ../deployment/env Status.app/Contents/Resources"
189
- sh ' ln -sf ../Resources/env Status.app/Contents/MacOS/env'
190
- sh ' cp -f ../deployment/macos/qt-reportApp.conf Status.app/Contents/Resources'
191
- sh ' ln -sf ../Resources/qt-reportApp.conf Status.app/Contents/MacOS/qt.conf'
192
- sh ' install_name_tool -add_rpath "@executable_path/../Frameworks" ' +
193
- ' -delete_rpath "/Users/administrator/qt/5.9.1/clang_64/lib" ' +
194
- ' Status.app/Contents/MacOS/reportApp'
195
- sh ' cp -f ../deployment/macos/Info.plist Status.app/Contents'
196
- sh ' cp -f ../deployment/macos/status-icon.icns Status.app/Contents/Resources'
197
- sh """
198
- macdeployqt Status.app -verbose=1 \\
199
- -qmldir='${ workspace} /node_modules/react-native/ReactQt/runtime/src/qml/'
200
- """
201
- sh ' rm -f Status.app.zip'
202
-
203
78
withCredentials([
204
79
string(credentialsId : ' desktop-gpg-outer-pass' , variable : ' GPG_PASS_OUTER' ),
205
80
string(credentialsId : ' desktop-gpg-inner-pass' , variable : ' GPG_PASS_INNER' ),
0 commit comments