pipeline {
	agent {
		label "built-in"
	}
	stages {
		stage("Build") {
			parallel {
				stage("Build for Linux 64-bit") {
					agent {
						label "built-in"
					}
					steps {
						sh("make clean")
						sh("make -j4 IS_MUSL_CROSS=1")
						sh("mv pmake pmake-linux64")
						archiveArtifacts("pmake-linux64")
					}
				}
				stage("Build for Windows 32-bit") {
					agent {
						label "built-in"
					}
					environment {
						WATCOM = "/usr/watcom"
						INCLUDE = "/usr/watcom/h:/usr/watcom/h/nt"
						PATH = "/usr/watcom/binl64:${env.PATH}"
					}
					steps {
						sh("make clean")
						sh("make -j4 TARGET=Watcom")
						sh("mv pmake.exe pmake-win32.exe")
						archiveArtifacts("pmake-win32.exe")
					}
				}
			}
			post {
				always {
					notifyDiscord()
				}
			}
		}
	}
}
