status-go/_assets/ci/Jenkinsfile.ios

78 lines
2.0 KiB
Plaintext

library 'status-jenkins-lib@v1.3.3'
pipeline {
agent { label 'macos && x86_64' }
parameters {
string(
name: 'BRANCH',
defaultValue: 'develop',
description: 'Name of branch to build.'
)
booleanParam(
name: 'RELEASE',
defaultValue: false,
description: 'Enable to create build for release.',
)
}
options {
timestamps()
disableConcurrentBuilds()
/* Go requires a certain directory structure */
checkoutToSubdirectory('src/github.com/status-im/status-go')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '5',
daysToKeepStr: '30',
))
}
environment {
/* fix for gomobile complaining about missing packages */
CGO_ENABLED = "1"
/* Other stuff */
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"
}
stages {
stage('Prep') { steps { dir(env.REPO) { script {
env.ARTIFACT = "${env.WORKSPACE}/" + utils.pkgFilename(
name: "status-go",
type: "ios",
ext: "zip"
)
println("Output: ${env.ARTIFACT}")
} } } }
stage('Setup') { steps { dir(env.REPO) {
sh 'unset TMPDIR && make setup-build'
} } }
stage('Compile') { steps { dir(env.REPO) {
sh 'make statusgo-ios'
sh 'go get golang.org/x/tools/go/packages'
dir('build/bin') {
sh 'zip -r status-go-ios.zip Statusgo.framework'
sh "cp status-go-ios.zip ${env.ARTIFACT}"
}
} } }
stage('Archive') { steps {
archiveArtifacts(env.ARTIFACT.minus("${env.WORKSPACE}/"))
} }
stage('Upload') { steps { script {
env.PKG_URL = s3.uploadArtifact(env.ARTIFACT)
} } }
} // stages
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
always { dir(env.REPO) { sh 'make clean' } }
} // post
} // pipeline