Bring back Windows support

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
Jacob Kiers 2022-09-07 22:15:58 +02:00
parent 6bdd545cec
commit 7bc8c5b967

View File

@ -1,13 +1,15 @@
local archs = [ local archs = [
{ target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' }, { target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' },
{ target: 'aarch64-unknown-linux-musl', short: 'arm64-musl' }, { target: 'aarch64-unknown-linux-musl', short: 'arm64-musl' },
// { target: 'x86_64-pc-windows-gnu', short: 'windows-amd64' }, { target: 'x86_64-pc-windows-gnu', short: 'windows-amd64' },
{ target: 'x86_64-unknown-linux-gnu', short: 'amd64-gnu' }, { target: 'x86_64-unknown-linux-gnu', short: 'amd64-gnu' },
{ target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' }, { target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' },
]; ];
local getStepName(arch) = 'build ' + arch.short; local getStepName(arch) = 'build ' + arch.short;
local getExeName(arch) = if std.startsWith(arch.short, 'windows') then '.exe' else '';
local add_build_steps() = [ local add_build_steps() = [
{ {
name: getStepName(arch), name: getStepName(arch),
@ -26,7 +28,7 @@ local add_build_steps() = [
'echo Hello World from Jsonnet on ' + arch.target + '!', 'echo Hello World from Jsonnet on ' + arch.target + '!',
'cross build --release --target ' + arch.target, 'cross build --release --target ' + arch.target,
'rm -rf target/' + arch.target + '/release/{build,deps,examples,incremental}', 'rm -rf target/' + arch.target + '/release/{build,deps,examples,incremental}',
'cp target/' + arch.target + '/release/drone-test artifacts/drone-test-' + arch.short, 'cp target/' + arch.target + '/release/drone-test' + getExeName(arch) + ' artifacts/drone-test-' + arch.short + getExeName(arch),
], ],
environment: { environment: {
CROSS_REMOTE: true, CROSS_REMOTE: true,