Files
thilatrait/.drone.jsonnet
Julien Valverdé 2ccdb7184f
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Fixed?
2023-12-29 03:58:39 +01:00

110 lines
2.1 KiB
Jsonnet

local bun_image = "oven/bun:1";
local fetch_step = {
name: "fetch",
image: "alpine/git",
commands: ["git fetch --tags"],
};
local install_step = {
name: "install",
image: bun_image,
commands: ["bun install --frozen-lockfile"],
};
local lint_step = {
name: "lint",
image: bun_image,
commands: ["bun lint:tsc"],
};
local build_step = {
name: "build",
image: bun_image,
commands: ["bun run build"],
};
local publish_step = {
name: "publish",
image: "node:20",
environment: {
NPM_TOKEN: { from_secret: "npm_token" }
},
commands: [
"npm set registry https://git.jvalver.de/api/packages/thilawyn/npm/",
"npm config set -- //git.jvalver.de/api/packages/thilawyn/npm/:_authToken $NPM_TOKEN",
"npm publish",
],
};
[
// Lint the whole project when not in master, not in a PR nor on a tag
{
kind: "pipeline",
type: "docker",
name: "lint",
trigger: {
ref: {
exclude: [
"refs/heads/master",
"refs/pull/**",
"refs/tags/**",
]
}
},
steps: [
install_step,
lint_step,
],
},
// Build the package without publishing for pull requests
{
kind: "pipeline",
type: "docker",
name: "build",
trigger: {
ref: {
include: ["refs/pull/**"]
}
},
steps: [
install_step,
lint_step,
build_step,
publish_step,
],
},
// Build and publish the package for master and tags
{
kind: "pipeline",
type: "docker",
name: "build-publish",
trigger: {
ref: {
include: [
"refs/heads/master",
"refs/tags/**",
]
}
},
steps: [
install_step,
lint_step,
build_step,
publish_step,
],
},
]