mirror of
https://github.com/status-im/status-go.git
synced 2025-02-12 23:06:51 +00:00
100 lines
2.9 KiB
Groovy
100 lines
2.9 KiB
Groovy
pipeline {
|
|
agent { label 'linux' }
|
|
|
|
parameters {
|
|
booleanParam(
|
|
name: 'GITHUB_RELEASE',
|
|
description: 'Enable this to create a new GitHub release.',
|
|
defaultValue: false,
|
|
)
|
|
}
|
|
|
|
options {
|
|
disableConcurrentBuilds()
|
|
/* Go requires a certain directory structure */
|
|
checkoutToSubdirectory('src/github.com/status-im/status-go')
|
|
/* manage how many builds we keep */
|
|
buildDiscarder(logRotator(
|
|
numToKeepStr: '30',
|
|
daysToKeepStr: '30',
|
|
))
|
|
}
|
|
|
|
environment {
|
|
STATUS_PATH = 'src/github.com/status-im/status-go'
|
|
GOPATH = "${env.WORKSPACE}"
|
|
PATH = "${env.PATH}:${env.GOPATH}/bin"
|
|
}
|
|
|
|
stages {
|
|
stage('Prep') {
|
|
steps { script {
|
|
lib = load("${env.STATUS_PATH}/_assets/ci/lib.groovy")
|
|
println("Git Branch: ${lib.gitBranch()}")
|
|
println("Git Commit: ${lib.gitCommit()}")
|
|
} }
|
|
}
|
|
stage('Setup') { steps { dir(env.STATUS_PATH) {
|
|
sh 'make setup'
|
|
} } }
|
|
stage('Lint') { steps { dir(env.STATUS_PATH) {
|
|
sh 'make ci'
|
|
} } }
|
|
stage('Build') {
|
|
parallel {
|
|
stage('Android') {
|
|
stages {
|
|
stage('Compile') { steps { dir(env.STATUS_PATH) {
|
|
sh 'make statusgo-android'
|
|
} } }
|
|
stage('Archive') { steps {
|
|
sh """
|
|
mv ${env.STATUS_PATH}/build/bin/statusgo-android-16.aar \
|
|
${env.WORKSPACE}/status-go-android-${lib.suffix()}.aar
|
|
"""
|
|
archiveArtifacts("status-go-android-${lib.suffix()}.aar")
|
|
} }
|
|
stage('Upload') { steps { script {
|
|
lib.uploadArtifact("status-go-android-${lib.suffix()}.aar")
|
|
} } }
|
|
}
|
|
}
|
|
stage('iOS') {
|
|
stages {
|
|
stage('Compile') { steps { dir(env.STATUS_PATH) {
|
|
sh 'make statusgo-ios-simulator'
|
|
dir('build/bin/statusgo-ios-9.3-framework') {
|
|
sh 'zip -r status-go-ios.zip Statusgo.framework'
|
|
}
|
|
} } }
|
|
stage('Archive') { steps {
|
|
sh """
|
|
mv ${env.STATUS_PATH}/build/bin/statusgo-ios-9.3-framework/status-go-ios.zip \
|
|
${env.WORKSPACE}/status-go-ios-${lib.suffix()}.zip
|
|
"""
|
|
archiveArtifacts("status-go-ios-${lib.suffix()}.zip")
|
|
} }
|
|
stage('Upload') { steps { script {
|
|
lib.uploadArtifact("status-go-ios-${lib.suffix()}.zip")
|
|
} } }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Release') { when { expression { params.GITHUB_RELEASE == true } }
|
|
steps {
|
|
sh 'make prepare-release'
|
|
withCredentials([[
|
|
$class: 'UsernamePasswordMultiBinding',
|
|
credentialsId: 'status-im-auto',
|
|
usernameVariable: 'GITHUB_USER',
|
|
passwordVariable: 'GITHUB_TOKEN'
|
|
]]) {
|
|
sh "yes | make release release_branch=${gitBranch}"
|
|
}
|
|
sh 'make clean-release'
|
|
}
|
|
}
|
|
}
|
|
}
|