2022-07-18 18:17:48 +00:00
|
|
|
library 'status-jenkins-lib@v1.5.6'
|
2020-08-28 11:55:48 +00:00
|
|
|
|
2022-09-21 10:06:45 +00:00
|
|
|
/* Options section can't access functions in objects. */
|
|
|
|
def isPRBuild = utils.isPRBuild()
|
|
|
|
|
2020-08-28 11:55:48 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'windows' }
|
|
|
|
|
2021-04-19 14:45:46 +00:00
|
|
|
parameters {
|
2022-02-09 10:52:14 +00:00
|
|
|
booleanParam(
|
|
|
|
name: 'RELEASE',
|
|
|
|
description: 'Decides whether binaries are built with debug symbols.',
|
|
|
|
defaultValue: params.RELEASE ?: false
|
2021-04-19 14:45:46 +00:00
|
|
|
)
|
2022-02-09 10:59:41 +00:00
|
|
|
choice(
|
|
|
|
name: 'VERBOSE',
|
|
|
|
description: 'Level of verbosity based on nimbus-build-system setup.',
|
|
|
|
choices: ['0', '1', '2']
|
|
|
|
)
|
2021-04-19 14:45:46 +00:00
|
|
|
}
|
|
|
|
|
2020-08-28 11:55:48 +00:00
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 25, unit: 'MINUTES')
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
2020-11-24 18:42:31 +00:00
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '30',
|
2021-03-25 20:49:27 +00:00
|
|
|
artifactNumToKeepStr: '3',
|
2020-08-28 11:55:48 +00:00
|
|
|
))
|
2022-09-21 10:06:45 +00:00
|
|
|
/* Abort old PR builds. */
|
|
|
|
disableConcurrentBuilds(
|
|
|
|
abortPrevious: isPRBuild
|
|
|
|
)
|
2020-08-28 11:55:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
TARGET = 'windows'
|
|
|
|
/* Improve make performance */
|
2022-07-18 18:17:48 +00:00
|
|
|
MAKEFLAGS = "-j${utils.getProcCount()} V=${params.VERBOSE}"
|
2020-08-28 11:55:48 +00:00
|
|
|
/* Disable colors in Nim compiler logs */
|
|
|
|
NIMFLAGS = '--colors:off'
|
|
|
|
/* Control output the filename */
|
2021-09-28 11:57:19 +00:00
|
|
|
STATUS_CLIENT_EXE = "pkg/${utils.pkgFilename(ext: 'exe')}"
|
2021-09-15 07:44:36 +00:00
|
|
|
/* 7zip archive filename */
|
2021-09-28 11:57:19 +00:00
|
|
|
STATUS_CLIENT_7Z = "pkg/${utils.pkgFilename(ext: '7z')}"
|
2021-04-19 14:45:46 +00:00
|
|
|
/* RFC 3161 timestamping URL for DigiCert */
|
|
|
|
WINDOWS_CODESIGN_TIMESTAMP_URL = 'http://timestamp.digicert.com'
|
2020-08-28 11:55:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2020-09-28 19:24:21 +00:00
|
|
|
stage('Deps') {
|
2020-08-28 11:55:48 +00:00
|
|
|
steps {
|
2021-04-14 12:44:13 +00:00
|
|
|
/* trigger fetching of git submodules */
|
|
|
|
sh 'make check-pkg-target-windows'
|
2022-04-15 09:17:19 +00:00
|
|
|
/* TODO: Re-add caching of Nim compiler. */
|
|
|
|
sh 'make deps'
|
2020-08-28 11:55:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('status-go') {
|
2022-07-18 18:17:48 +00:00
|
|
|
steps {
|
|
|
|
sh 'make status-go'
|
|
|
|
}
|
2020-08-28 11:55:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stage('Package') {
|
2021-04-19 14:45:46 +00:00
|
|
|
steps { script {
|
2021-09-16 13:21:55 +00:00
|
|
|
windows.bundle("${env.STATUS_CLIENT_EXE} ${env.STATUS_CLIENT_7Z}")
|
2021-04-19 14:45:46 +00:00
|
|
|
} }
|
2020-08-28 11:55:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stage('Parallel Upload') {
|
2022-07-18 18:17:48 +00:00
|
|
|
/* Uploads on Windows are slow. */
|
2020-08-28 11:55:48 +00:00
|
|
|
parallel {
|
2022-07-18 18:17:48 +00:00
|
|
|
stage('Upload 7Z') {
|
2020-08-28 11:55:48 +00:00
|
|
|
steps { script {
|
2021-09-15 07:44:36 +00:00
|
|
|
zip_url = s3.uploadArtifact(env.STATUS_CLIENT_7Z)
|
2020-08-28 11:55:48 +00:00
|
|
|
} }
|
|
|
|
}
|
2022-07-18 18:17:48 +00:00
|
|
|
stage('Upload EXE') {
|
2020-08-28 11:55:48 +00:00
|
|
|
steps { script {
|
2022-07-18 18:17:48 +00:00
|
|
|
exe_url = s3.uploadArtifact(env.STATUS_CLIENT_EXE)
|
2020-08-28 11:55:48 +00:00
|
|
|
} }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-18 18:17:48 +00:00
|
|
|
|
|
|
|
stage('Archive') {
|
|
|
|
steps { script {
|
|
|
|
archiveArtifacts(env.STATUS_CLIENT_EXE)
|
|
|
|
archiveArtifacts(env.STATUS_CLIENT_7Z)
|
|
|
|
env.PKG_URL = exe_url
|
|
|
|
jenkins.setBuildDesc(Zip: zip_url, Exe: exe_url)
|
|
|
|
} }
|
|
|
|
}
|
2020-08-28 11:55:48 +00:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
2022-10-26 10:00:39 +00:00
|
|
|
cleanup { cleanWs(disableDeferredWipeout: true, deleteDirs: true) }
|
2020-08-28 11:55:48 +00:00
|
|
|
}
|
|
|
|
}
|