status-desktop/ci/cpp/Jenkinsfile.macos
Sale Djenic f88c23dc7b refactor(@desktop/general): env variables sorted and CL args introduced
- Necessary env variables to build the app:
STATUS_BUILD_INFURA_TOKEN
STATUS_BUILD_INFURA_TOKEN_SECRET
STATUS_BUILD_POKT_TOKEN
STATUS_BUILD_OPENSEA_API_KEY
STATUS_BUILD_ALCHEMY_ETHEREUM_MAINNET_TOKEN
STATUS_BUILD_ALCHEMY_ETHEREUM_GOERLI_TOKEN
STATUS_BUILD_ALCHEMY_ARBITRUM_MAINNET_TOKEN
STATUS_BUILD_ALCHEMY_ARBITRUM_GOERLI_TOKEN
STATUS_BUILD_ALCHEMY_OPTIMISM_MAINNET_TOKEN
STATUS_BUILD_ALCHEMY_OPTIMISM_GOERLI_TOKEN

- The list of available env variables as well as CL arguments can be seen running
the app providing `--help` argument. All env vars are prefixed with `STATUS_RUNTIME_`.
2023-10-24 13:16:58 +02:00

84 lines
2.1 KiB
Groovy

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.17'
/* Options section can't access functions in objects. */
def isPRBuild = utils.isPRBuild()
pipeline {
agent {
docker {
label 'linux'
image 'stateoftheartio/qt6:6.3-macos-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',
))
/* Abort old PR builds. */
disableConcurrentBuilds(
abortPrevious: isPRBuild
)
}
environment {
TARGET = 'macos-cpp'
/* 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) } }
cleanup { sh './scripts/clean-git.sh' }
}
}