Files
thilatrait/.drone.jsonnet
Julien Valverdé 0241167018
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Debug
2023-12-29 03:06:58 +01:00

122 lines
2.4 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: "plugins/npm",
// settings: {
// registry: "https://git.jvalver.de/api/packages/jvalverde/npm",
// token: { from_secret: "npm_token" },
// },
// };
local publish_step = {
name: "publish",
image: "node:18",
environment: {
NPM_TOKEN: { from_secret: "npm_token" }
},
commands: [
"npm version",
"npm set registry https://git.jvalver.de/api/packages/jvalverde/npm",
"npm config set -- '//git.jvalver.de/api/packages/jvalverde/npm/:_authToken' '$NPM_TOKEN'",
"npm whoami",
"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,
],
},
]