2023-08-01 10:27:46 +00:00
|
|
|
library 'status-jenkins-lib@v1.7.10'
|
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-mingw-aqt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
booleanParam(
|
|
|
|
name: 'RELEASE',
|
|
|
|
description: 'Decides whether binaries are built with debug symbols.',
|
|
|
|
defaultValue: params.RELEASE ?: false
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
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',
|
|
|
|
artifactNumToKeepStr: '3',
|
|
|
|
))
|
2022-09-21 10:06:45 +00:00
|
|
|
/* Abort old PR builds. */
|
|
|
|
disableConcurrentBuilds(
|
|
|
|
abortPrevious: isPRBuild
|
|
|
|
)
|
2022-06-07 10:58:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
TARGET = 'windows-cpp'
|
|
|
|
/* Control output the filename */
|
|
|
|
STATUS_CLIENT_ZIP = "pkg/${utils.pkgFilename(ext: 'zip')}"
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Move all stages to the Makefile as targets "*-windows-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 "windeployqt --qmldir ${env.WORKSPACE} --dir ${env.WORKSPACE}/build/deploy --libdir ${env.WORKSPACE}/build/deploy/libs --plugindir ${env.WORKSPACE}/build/deploy/plugins ${env.WORKSPACE}/build/*.exe"
|
|
|
|
sh "zip -r ${STATUS_CLIENT_ZIP} build/deploy/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Parallel Upload') {
|
|
|
|
parallel {
|
|
|
|
stage('Upload') {
|
|
|
|
steps { script {
|
|
|
|
exe_url = s3.uploadArtifact(env.STATUS_CLIENT_ZIP)
|
|
|
|
env.PKG_URL = exe_url
|
|
|
|
jenkins.setBuildDesc(Zip: zip_url, Exe: exe_url)
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
stage('Archive') {
|
|
|
|
steps { script {
|
|
|
|
archiveArtifacts(env.STATUS_CLIENT_ZIP)
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|