status-go/_assets/ci/Jenkinsfile.ios

87 lines
2.1 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.6'
2019-02-01 17:02:52 +00:00
pipeline {
agent { label 'macos && aarch64 && xcode-15.1 && nix-2.19' }
2019-02-01 17:02:52 +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 {
timestamps()
ansiColor('xterm')
/* Prevent Jenkins jobs from running forever */
timeout(time: 10, unit: 'MINUTES')
disableConcurrentBuilds()
2019-02-01 17:02:52 +00:00
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '5',
2019-02-01 17:02:52 +00:00
daysToKeepStr: '30',
artifactNumToKeepStr: '1',
2019-02-01 17:02:52 +00:00
))
}
environment {
PLATFORM = 'ios'
TMPDIR = "${WORKSPACE_TMP}"
GOPATH = "${WORKSPACE_TMP}/go"
GOCACHE = "${WORKSPACE_TMP}/gocache"
PATH = "${PATH}:${GOPATH}/bin"
REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
VERSION = sh(script: "./_assets/scripts/version.sh", returnStdout: true)
ARTIFACT = utils.pkgFilename(
name: 'status-go',
type: env.PLATFORM,
version: env.VERSION,
ext: 'zip',
)
/* fix for gomobile complaining about missing packages */
CGO_ENABLED = "1"
2019-02-01 17:02:52 +00:00
}
stages {
stage('Prep') {
steps { /* Go needs to find status-go in GOPATH. */
sh "mkdir -p \$(dirname ${REPO_SRC})"
sh "ln -s ${WORKSPACE} ${REPO_SRC}"
}
}
2019-02-01 17:02:52 +00:00
stage('Compile') {
steps { script {
nix.shell('make statusgo-ios', pure: false, sandbox: false)
} }
}
2019-02-01 17:02:52 +00:00
stage('Archive') {
steps {
dir('build/bin') {
sh "zip -r ${WORKSPACE}/${ARTIFACT} Statusgo.xcframework"
}
archiveArtifacts(ARTIFACT)
2019-02-01 17:02:52 +00:00
}
}
2019-02-01 17:02:52 +00:00
stage('Upload') {
steps { script {
env.PKG_URL = s3.uploadArtifact(ARTIFACT)
} }
}
2019-02-01 17:02:52 +00:00
} // stages
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make deep-clean' }
} // post
2019-02-01 17:02:52 +00:00
} // pipeline