Compare commits

...

5 Commits

Author SHA1 Message Date
97b4d16a33 Only create release on tag or promotion
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build was killed
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:38:08 +02:00
ced47d0cc7 Create release on build
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:34:36 +02:00
2a041ae332 Small improvements
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:19:30 +02:00
7bc8c5b967 Bring back Windows support
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:15:58 +02:00
6bdd545cec Remove unnecessary function buildForArch()
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-09-07 22:10:29 +02:00

View File

@@ -1,41 +1,41 @@
local archs = [
{ target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' },
{ 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-musl', short: 'amd64-musl' },
];
local getStepName(arch) = 'check ' + arch.short;
local getStepName(arch) = 'Build for ' + arch.short;
local buildForArch(arch) = {
name: getStepName(arch),
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
{
name: 'rustup',
path: '/usr/local/rustup',
},
],
commands: [
'echo Hello World from Jsonnet on ' + arch.target + '!',
'cross build --release --target ' + arch.target,
'rm -rf target/' + arch.target + '/release/{build,deps,examples,incremental}',
'cp target/' + arch.target + '/release/drone-test artifacts/drone-test-' + arch.short,
],
environment: {
CROSS_REMOTE: true,
},
depends_on: ['wait-for-docker'],
};
local getExeName(arch) = if std.startsWith(arch.short, 'windows') then '.exe' else '';
local check_steps() = [
buildForArch(a)
for a in archs
local add_build_steps() = [
{
name: getStepName(arch),
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
{
name: 'rustup',
path: '/usr/local/rustup',
},
],
commands: [
'echo Hello World from Jsonnet on ' + arch.target + '!',
'cross build --release --target ' + arch.target,
'cp target/' + arch.target + '/release/drone-test' + getExeName(arch) + ' artifacts/drone-test-' + arch.short + getExeName(arch),
'rm -rf target/' + arch.target + '/release/*',
],
environment: {
CROSS_REMOTE: true,
},
depends_on: ['Wait for Docker'],
}
for arch in archs
];
{
@@ -47,7 +47,7 @@ local check_steps() = [
},
steps:
[{
name: 'wait-for-docker',
name: 'Wait for Docker',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
commands: [
'while ! docker image ls; do sleep 1; done',
@@ -60,17 +60,31 @@ local check_steps() = [
path: '/var/run',
}],
}] +
check_steps() +
add_build_steps() +
[
{
name: 'build',
name: 'Show built artifacts',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
commands: [
'ls -lah target/',
'ls -lah artifacts',
],
depends_on: [getStepName(a) for a in archs],
},
{
name: 'Create release on gitea',
image: 'plugins/gitea-release',
settings: {
api_key: {
from_secret: 'gitea_token',
},
base_url: 'https://code.kiers.eu',
files: 'artifacts/*',
checksum: 'sha256',
},
when: {
event: ['tag', 'promote'],
},
},
],
services: [{