2023-08-08 12:06:06 +00:00
|
|
|
#!/usr/bin/env groovy
|
2024-08-14 11:25:48 +00:00
|
|
|
library 'status-jenkins-lib@v1.9.5'
|
2022-06-07 10:58:06 +00:00
|
|
|
|
2022-09-21 10:06:45 +00:00
|
|
|
/* Options section can't access functions in objects. */
|
|
|
|
def isPRBuild = utils.isPRBuild()
|
|
|
|
|
2022-06-07 10:58:06 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
label 'linux'
|
|
|
|
image 'stateoftheartio/qt6:6.3-macos-aqt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
booleanParam(
|
|
|
|
name: 'RELEASE',
|
2024-02-23 09:19:57 +00:00
|
|
|
description: 'Decides whether release credentials are used.',
|
2022-06-07 10:58:06 +00:00
|
|
|
defaultValue: params.RELEASE ?: false
|
|
|
|
)
|
2024-02-23 09:19:57 +00:00
|
|
|
booleanParam(
|
|
|
|
name: 'INCLUDE_DEBUG_SYMBOLS',
|
|
|
|
description: 'Decides whether binaries are built with debug symbols.',
|
|
|
|
defaultValue: params.INCLUDE_DEBUG_SYMBOLS ?: false
|
|
|
|
)
|
2022-06-07 10:58:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 20, unit: 'MINUTES')
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '30',
|
2024-02-28 14:56:40 +00:00
|
|
|
artifactNumToKeepStr: '1',
|
2022-06-07 10:58:06 +00:00
|
|
|
))
|
2022-09-21 10:06:45 +00:00
|
|
|
/* Abort old PR builds. */
|
|
|
|
disableConcurrentBuilds(
|
|
|
|
abortPrevious: isPRBuild
|
|
|
|
)
|
2022-06-07 10:58:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2024-03-27 12:23:31 +00:00
|
|
|
PLATFORM = 'macos-cpp'
|
2022-06-07 10:58:06 +00:00
|
|
|
/* Control output the filename */
|
|
|
|
STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg')}"
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Move all stages to the Makefile as targets "*-mac-using-docker"
|
|
|
|
stages {
|
|
|
|
stage('CMake Build') {
|
|
|
|
steps {
|
|
|
|
sh "qt-cmake ${env.WORKSPACE} -G Ninja -B ${env.WORKSPACE}/build -DCMAKE_BUILD_TYPE=Release"
|
|
|
|
sh "cmake --build ${env.WORKSPACE}/build"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Package') {
|
|
|
|
steps {
|
|
|
|
sh "macdeployqt ${env.WORKSPACE}/build/*.app -verbose=1 -dmg -qmldir=${env.WORKSPACE}"
|
|
|
|
sh "mkdir pkg && cp \"\$(find ${env.WORKSPACE}/build -maxdepth 2 -type f -iname \"*.dmg\")\" ${env.STATUS_CLIENT_DMG}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Parallel Upload') {
|
|
|
|
parallel {
|
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
|
|
|
env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_DMG)
|
|
|
|
jenkins.setBuildDesc(Dmg: env.PKG_URL)
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Archive') {
|
|
|
|
steps { script {
|
|
|
|
archiveArtifacts(env.STATUS_CLIENT_DMG)
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2022-11-22 12:40:45 +00:00
|
|
|
cleanup { sh './scripts/clean-git.sh' }
|
2022-06-07 10:58:06 +00:00
|
|
|
}
|
|
|
|
}
|