2022-06-19 21:50:37 +00:00
|
|
|
library 'status-jenkins-lib@v1.3.3'
|
|
|
|
|
|
|
|
pipeline {
|
2023-04-03 14:26:31 +00:00
|
|
|
agent { label 'macos && x86_64 && go-1.19' }
|
2022-06-19 21:50:37 +00:00
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 30, unit: 'MINUTES')
|
|
|
|
/* Go requires a certain directory structure */
|
2022-11-09 19:53:01 +00:00
|
|
|
checkoutToSubdirectory('src/github.com/waku-org/go-waku')
|
2022-06-19 21:50:37 +00:00
|
|
|
/* Limit builds retained */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '20',
|
|
|
|
artifactNumToKeepStr: '10',
|
|
|
|
))
|
|
|
|
/* Allows combined build to copy */
|
|
|
|
copyArtifactPermission('/go-waku/*')
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
BUILD_PLATFORM = 'android'
|
|
|
|
|
|
|
|
/* Other stuff */
|
|
|
|
TARGET = 'ios'
|
2022-11-09 19:53:01 +00:00
|
|
|
REPO = "${env.WORKSPACE}/src/github.com/waku-org/go-waku"
|
2022-06-19 21:50:37 +00:00
|
|
|
GOPATH = "${env.WORKSPACE}"
|
|
|
|
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
|
|
|
|
stage('Prep') { steps { dir(env.REPO) { script {
|
|
|
|
env.ARTIFACT = "${env.REPO}/pkg/" + utils.pkgFilename(
|
|
|
|
name: "go-waku",
|
|
|
|
type: "ios",
|
|
|
|
ext: "tar.gz"
|
|
|
|
)
|
|
|
|
|
|
|
|
sh 'make install-gomobile'
|
|
|
|
|
|
|
|
println("Output: ${env.ARTIFACT}")
|
|
|
|
} } } }
|
|
|
|
|
|
|
|
stage('Build') { steps { dir(env.REPO) {
|
|
|
|
sh 'make mobile-ios'
|
|
|
|
dir('build/lib') {
|
|
|
|
sh 'tar -czvf gowaku-ios.tar.gz Gowaku.xcframework'
|
|
|
|
sh "cp gowaku-ios.tar.gz ${env.ARTIFACT}"
|
|
|
|
}
|
|
|
|
} } }
|
|
|
|
|
|
|
|
stage('Parallel Upload') {
|
|
|
|
parallel {
|
|
|
|
stage('Archive') {
|
|
|
|
steps { script {
|
|
|
|
archiveArtifacts(env.ARTIFACT.minus("${env.WORKSPACE}/"))
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
|
|
|
env.PKG_URL = s3.uploadArtifact(env.ARTIFACT)
|
|
|
|
jenkins.setBuildDesc(ios: env.PKG_URL)
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
|
|
|
always { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|