awl/.drone.jsonnet
Sam Therapy 7607c68d5b
All checks were successful
continuous-integration/drone/push Build is passing
I am a moron
Signed-off-by: Sam Therapy <sam@samtherapy.net>
2022-07-26 00:45:33 +02:00

81 lines
No EOL
1.4 KiB
Text

// SPDX-License-Identifier: BSD-3-Clause
local testing(version, arch) = {
kind: "pipeline",
name: version + "-" + arch ,
platform: {
arch: arch
},
steps: [
{
name: "submodules",
image: "alpine/git",
commands: [
"git submodule update --init --recursive"
]
},
{
name: "lint",
image: "rancher/drone-golangci-lint:latest"
},
{
name: "test",
image: "golang:" + version,
commands: [
"go test -race ./... -cover"
]
},
],
trigger: {
event: {
exclude: "tag",
}
},
};
// "Inspired by" https://goreleaser.com/ci/drone/
local release() = {
kind: "pipeline",
name: "release",
trigger: {
event: "tag"
},
steps: [
{
name: "fetch",
image: "docker:git",
commands : [
"git fetch --tags",
"git submodule update --init --recursive"
]
},
{
name: "test",
image: "golang",
commands: [
"go test -race ./... -cover"
]
},
{
name: "release",
image: "goreleaser/goreleaser",
environment: {
"GITEA_TOKEN": {
from_secret: "GITEA_TOKEN"
}
},
commands: [
"goreleaser release"
],
// when: {
// event: "tag"
// }
}
]
};
[
testing("1.18", "amd64"),
testing("1.18", "arm64"),
release()
]