2023-11-21 15:39:11 +00:00
|
|
|
#!/usr/bin/env groovy
|
2024-08-20 07:38:38 +00:00
|
|
|
library 'status-jenkins-lib@v1.9.6'
|
2021-05-06 15:14:58 +00:00
|
|
|
|
2019-02-01 17:02:52 +00:00
|
|
|
pipeline {
|
2024-02-13 18:46:32 +00:00
|
|
|
agent { label 'macos && aarch64 && xcode-15.1 && nix-2.19' }
|
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()
|
2024-06-21 00:34:44 +00:00
|
|
|
ansiColor('xterm')
|
2023-05-29 10:40:00 +00:00
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 10, unit: 'MINUTES')
|
2019-02-25 09:04:53 +00:00
|
|
|
disableConcurrentBuilds()
|
2019-02-01 17:02:52 +00:00
|
|
|
/* 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',
|
2024-02-28 14:47:23 +00:00
|
|
|
artifactNumToKeepStr: '1',
|
2019-02-01 17:02:52 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2023-11-23 14:55:13 +00:00
|
|
|
PLATFORM = 'ios'
|
2023-01-03 14:40:45 +00:00
|
|
|
TMPDIR = "${WORKSPACE_TMP}"
|
2022-12-02 18:03:35 +00:00
|
|
|
GOPATH = "${WORKSPACE_TMP}/go"
|
2023-08-18 12:24:07 +00:00
|
|
|
GOCACHE = "${WORKSPACE_TMP}/gocache"
|
2022-12-02 18:03:35 +00:00
|
|
|
PATH = "${PATH}:${GOPATH}/bin"
|
|
|
|
REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
|
2024-08-20 07:38:38 +00:00
|
|
|
VERSION = sh(script: "./_assets/scripts/version.sh", returnStdout: true)
|
|
|
|
ARTIFACT = utils.pkgFilename(
|
|
|
|
name: 'status-go',
|
|
|
|
type: env.PLATFORM,
|
|
|
|
version: env.VERSION,
|
|
|
|
ext: 'zip',
|
|
|
|
)
|
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"
|
2024-10-03 19:59:44 +00:00
|
|
|
/* prevent sharing cache dir across different jobs */
|
|
|
|
GO_GENERATE_FAST_DIR = "${env.WORKSPACE_TMP}/go-generate-fast"
|
2019-02-01 17:02:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2022-12-02 18:03:35 +00:00
|
|
|
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
|
|
|
|
2024-10-03 19:59:44 +00:00
|
|
|
stage('Generate') {
|
|
|
|
steps { script {
|
|
|
|
nix.shell('make generate', pure: false)
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
|
2022-12-02 18:03:35 +00:00
|
|
|
stage('Compile') {
|
|
|
|
steps { script {
|
2023-04-27 18:22:46 +00:00
|
|
|
nix.shell('make statusgo-ios', pure: false, sandbox: false)
|
2022-12-02 18:03:35 +00:00
|
|
|
} }
|
|
|
|
}
|
2019-02-01 17:02:52 +00:00
|
|
|
|
2022-12-02 18:03:35 +00:00
|
|
|
stage('Archive') {
|
|
|
|
steps {
|
|
|
|
dir('build/bin') {
|
2024-08-20 07:38:38 +00:00
|
|
|
sh "zip -r ${WORKSPACE}/${ARTIFACT} Statusgo.xcframework"
|
2022-12-02 18:03:35 +00:00
|
|
|
}
|
|
|
|
archiveArtifacts(ARTIFACT)
|
2019-02-01 17:02:52 +00:00
|
|
|
}
|
2022-12-02 18:03:35 +00:00
|
|
|
}
|
2019-02-01 17:02:52 +00:00
|
|
|
|
2022-12-02 18:03:35 +00:00
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
|
|
|
env.PKG_URL = s3.uploadArtifact(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) } }
|
2023-11-02 17:20:35 +00:00
|
|
|
cleanup { sh 'make deep-clean' }
|
2019-02-07 12:12:35 +00:00
|
|
|
} // post
|
2019-02-01 17:02:52 +00:00
|
|
|
} // pipeline
|