-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile.ios
80 lines (67 loc) · 2.05 KB
/
Jenkinsfile.ios
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
@Library('conservify') _
properties([
disableConcurrentBuilds(),
buildDiscarder(logRotator(numToKeepStr: '5'))
])
def getBranch(scmInfo) {
def (remoteOrBranch, branch) = scmInfo.GIT_BRANCH.tokenize('/')
if (branch) {
return branch;
}
return remoteOrBranch;
}
timestamps {
node ("osx") {
try {
def scmInfo
stage ('git') {
scmInfo = checkout scm
}
stage ("configuration") {
withCredentials([file(credentialsId: 'app-mapbox-netrc', variable: 'APP_MAPBOX_NETRC')]) {
sh "cp -f $APP_MAPBOX_NETRC ~/.netrc"
}
withCredentials([file(credentialsId: 'app-ios-google-services', variable: 'APP_IOS_GOOGLE_SERVICES')]) {
sh "cp -f $APP_IOS_GOOGLE_SERVICES App_Resources/iOS"
}
withCredentials([file(credentialsId: 'nativescript-sqlite-commercial', variable: 'APP_NATIVESCRIPT_SQLITE')]) {
sh "cp -f $APP_NATIVESCRIPT_SQLITE ."
sh "unzip -o $APP_NATIVESCRIPT_SQLITE"
}
}
stage ('build') {
def branch = getBranch(scmInfo)
def buildType = "beta"
if (branch == "main") {
buildType = "release"
}
withEnv(["GIT_LOCAL_BRANCH=${branch}"]) {
withCredentials([string(credentialsId: 'app-ios-keychain-password', variable: 'APP_IOS_KEYCHAIN_PASSWORD')]) {
sh """
export PATH=$PATH:$HOME/tools/node/bin:node_modules/.bin
set +x
export APP_IOS_KEYCHAIN_PASSWORD=${APP_IOS_KEYCHAIN_PASSWORD}
export LANG=en_US.UTF-8
set -x
export BUILD_TYPE=${buildType}
env
arch -arm64 make clean-secrets
arch -arm64 make ios-release
"""
}
}
}
stage ('archive') {
def version = readFile('version.txt')
currentBuild.description = version.trim()
archiveArtifacts artifacts: 'platforms/ios/build/Debug-iphoneos/*.ipa, platforms/ios/build/Release-iphoneos/*.ipa'
}
refreshDistribution()
notifySuccess()
}
catch (Exception e) {
notifyFailure()
throw e;
}
}
}