From 0e475d13d36ab5273cd23f4b699edb04ddafda0c Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Wed, 20 Apr 2022 21:56:23 +0200 Subject: [PATCH] Build multiple Windows binaries - Modern: 64-Bit, Python 3.10, needs Windows > 7 - Legacy: 32-Bit, Python 3.8, needs Windows > XP --- Jenkinsfile | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 188b9095a..358109c71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -73,26 +73,37 @@ pys.each { py -> // MAIN // parallel(tasks) -stage('Windows binary') { - windowsBuild() -} -stage('Allure report') { - processAllure() -} +parallel modern: { + stage('Modern Windows binary') { + windowsBuild('3.10', 'dosage.exe') + } + }, + legacy: { + stage('Legacy Windows binary') { + // Still compatible with Windows 7 + windowsBuild('3.8', 'dosage-legacy.exe') + } + }, + report: { + stage('Allure report') { + processAllure() + } + }, failFast: true -def windowsBuild() { + +def windowsBuild(pyver, exename) { warnError('windows build failed') { node { - windowsBuildCommands() + windowsBuildCommands(pyver, exename) } } } -def windowsBuildCommands() { +def windowsBuildCommands(pyver, exename) { deleteDir() unstash 'bin' - // Keep 3.8 for now, so we are still compatible with Windows 7 - def img = docker.image('docker.io/tobix/pywine:3.8') + + def img = docker.image('docker.io/tobix/pywine:' + pyver) img.pull() img.inside { sh ''' @@ -105,7 +116,8 @@ def windowsBuildCommands() { wine py -m PyInstaller -y dosage.spec; wineserver -w" 2>&1 | tee log.txt ''' - archiveArtifacts '*/scripts/dist/*' + sh "mv */scripts/dist/*.exe $exename" + archiveArtifacts '*.exe' } }