pipeline { agent any stages { stage("Build on Linux") { agent { label 'linux' } steps { sh ''' #!/bin/bash ./compile.sh ''' } post { always { archiveArtifacts artifacts: "dart/out/*", fingerprint: true archiveArtifacts artifacts: "cpp/build/vsleep", fingerprint: true archiveArtifacts artifacts: "cpp/build/pause", fingerprint: true deleteDir() } } } stage("Build on Windows") { agent { label 'windows' } steps { bat ''' git clean -xfd git reset --hard mkdir cpp\\build cd cpp\\build cmake .. cmake --build . cd ..\\.. cd dart mkdir out dart pub get dart compile exe -o out\\dbikc.exe bin\\dbikc.dart dart compile exe -o out\\uuidgen.exe bin\\uuidgen.dart dart compile exe -o out\\mkfsreport.exe bin\\mkfsreport.dart dart compile exe -o out\\nbt2snbt.exe bin\\nbt2snbt.dart dart compile exe -o out\\snbt2nbt.exe bin\\snbt2nbt.dart dart compile exe -o out\\pause.exe bin\\pause.dart dart compile exe -o out\\sleep.exe bin\\sleep.dart cd .. ''' } post { always { archiveArtifacts artifacts: "dart\\out\\*.exe", fingerprint: true archiveArtifacts artifacts: "cpp\\build\\Debug\\vsleep.exe", fingerprint: true archiveArtifacts artifacts: "cpp\\build\\Debug\\pause.exe", fingerprint: true deleteDir() } } } } }