2021-09-28 07:52:00 +00:00
|
|
|
library 'status-jenkins-lib@v1.3.3'
|
2021-05-06 15:14:58 +00:00
|
|
|
|
2019-02-01 17:02:52 +00:00
|
|
|
pipeline {
|
2021-11-29 10:12:21 +00:00
|
|
|
agent { label 'macos && x86_64' }
|
2019-02-01 17:02:52 +00:00
|
|
|
|
2019-02-25 14:59:12 +00:00
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
name: 'BRANCH',
|
|
|
|
defaultValue: 'develop',
|
|
|
|
description: 'Name of branch to build.'
|
|
|
|
)
|
|
|
|
booleanParam(
|
|
|
|
name: 'RELEASE',
|
|
|
|
defaultValue: false,
|
|
|
|
description: 'Enable to create build for release.',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2019-02-01 17:02:52 +00:00
|
|
|
options {
|
2019-02-25 09:04:53 +00:00
|
|
|
timestamps()
|
|
|
|
disableConcurrentBuilds()
|
2019-02-01 17:02:52 +00:00
|
|
|
/* Go requires a certain directory structure */
|
|
|
|
checkoutToSubdirectory('src/github.com/status-im/status-go')
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
2021-03-04 17:08:34 +00:00
|
|
|
numToKeepStr: '5',
|
2019-02-01 17:02:52 +00:00
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2019-08-20 07:05:15 +00:00
|
|
|
/* fix for gomobile complaining about missing packages */
|
2021-05-06 15:14:58 +00:00
|
|
|
CGO_ENABLED = "1"
|
2019-08-20 07:05:15 +00:00
|
|
|
/* Other stuff */
|
2021-09-28 07:52:00 +00:00
|
|
|
TARGET = 'ios'
|
|
|
|
GOPATH = "${env.WORKSPACE}"
|
|
|
|
REPO = "${env.WORKSPACE}/src/github.com/status-im/status-go"
|
|
|
|
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
|
2019-02-01 17:02:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2021-09-28 07:52:00 +00:00
|
|
|
stage('Prep') { steps { dir(env.REPO) { script {
|
|
|
|
env.ARTIFACT = "${env.WORKSPACE}/" + utils.pkgFilename(
|
|
|
|
name: "status-go",
|
|
|
|
type: "ios",
|
|
|
|
ext: "zip"
|
|
|
|
)
|
|
|
|
println("Output: ${env.ARTIFACT}")
|
2021-05-06 15:14:58 +00:00
|
|
|
} } } }
|
2019-02-01 17:02:52 +00:00
|
|
|
|
2021-09-28 07:52:00 +00:00
|
|
|
stage('Setup') { steps { dir(env.REPO) {
|
2019-03-27 17:04:18 +00:00
|
|
|
sh 'unset TMPDIR && make setup-build'
|
2019-02-01 17:02:52 +00:00
|
|
|
} } }
|
|
|
|
|
2021-09-28 07:52:00 +00:00
|
|
|
stage('Compile') { steps { dir(env.REPO) {
|
2019-02-01 17:02:52 +00:00
|
|
|
sh 'make statusgo-ios'
|
2019-08-20 07:05:15 +00:00
|
|
|
sh 'go get golang.org/x/tools/go/packages'
|
2019-02-01 17:02:52 +00:00
|
|
|
dir('build/bin') {
|
|
|
|
sh 'zip -r status-go-ios.zip Statusgo.framework'
|
2021-05-06 15:14:58 +00:00
|
|
|
sh "cp status-go-ios.zip ${env.ARTIFACT}"
|
2019-02-01 17:02:52 +00:00
|
|
|
}
|
|
|
|
} } }
|
|
|
|
|
|
|
|
stage('Archive') { steps {
|
2021-05-06 15:14:58 +00:00
|
|
|
archiveArtifacts(env.ARTIFACT.minus("${env.WORKSPACE}/"))
|
2019-02-01 17:02:52 +00:00
|
|
|
} }
|
|
|
|
|
|
|
|
stage('Upload') { steps { script {
|
2021-05-06 15:14:58 +00:00
|
|
|
env.PKG_URL = s3.uploadArtifact(env.ARTIFACT)
|
2019-02-01 17:02:52 +00:00
|
|
|
} } }
|
|
|
|
} // stages
|
2019-02-07 12:12:35 +00:00
|
|
|
post {
|
2021-05-06 15:14:58 +00:00
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2021-09-28 07:52:00 +00:00
|
|
|
always { dir(env.REPO) { sh 'make clean' } }
|
2019-02-07 12:12:35 +00:00
|
|
|
} // post
|
2019-02-01 17:02:52 +00:00
|
|
|
} // pipeline
|