Build multiple Windows binaries

- Modern: 64-Bit, Python 3.10, needs Windows > 7
- Legacy: 32-Bit, Python 3.8, needs Windows > XP
This commit is contained in:
Tobias Gruetzmacher 2022-04-20 21:56:23 +02:00
parent 62ce301ce9
commit 0e475d13d3

34
Jenkinsfile vendored
View file

@ -73,26 +73,37 @@ pys.each { py ->
// MAIN // // MAIN //
parallel(tasks) parallel(tasks)
stage('Windows binary') { parallel modern: {
windowsBuild() stage('Modern Windows binary') {
} windowsBuild('3.10', 'dosage.exe')
stage('Allure report') { }
},
legacy: {
stage('Legacy Windows binary') {
// Still compatible with Windows 7
windowsBuild('3.8', 'dosage-legacy.exe')
}
},
report: {
stage('Allure report') {
processAllure() processAllure()
} }
}, failFast: true
def windowsBuild() {
def windowsBuild(pyver, exename) {
warnError('windows build failed') { warnError('windows build failed') {
node { node {
windowsBuildCommands() windowsBuildCommands(pyver, exename)
} }
} }
} }
def windowsBuildCommands() { def windowsBuildCommands(pyver, exename) {
deleteDir() deleteDir()
unstash 'bin' 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.pull()
img.inside { img.inside {
sh ''' sh '''
@ -105,7 +116,8 @@ def windowsBuildCommands() {
wine py -m PyInstaller -y dosage.spec; wine py -m PyInstaller -y dosage.spec;
wineserver -w" 2>&1 | tee log.txt wineserver -w" 2>&1 | tee log.txt
''' '''
archiveArtifacts '*/scripts/dist/*' sh "mv */scripts/dist/*.exe $exename"
archiveArtifacts '*.exe'
} }
} }