mvp-ai's picture
download
raw
1.99 kB
// Copyright (c) 2026 the Zuke contributors
// SPDX-License-Identifier: MIT
/**
* The third form of scripts/release.sh: the same steps as targets. Each step
* is now something you can run on its own, see in `--list`, and depend on —
* and the two git steps use the typed wrapper instead of `$`.
*
* zuke --release-version 1.1.0 # clean → test → tag → push
* zuke tag --release-version 1.1.0 # stop after the tag
* zuke --list
*/
import { Build, parameter, run, target } from "jsr:@zuke/core@^1";
import { $ } from "jsr:@zuke/core@^1/shell";
import { DenoTasks } from "jsr:@zuke/deno@^1";
import { GitTasks } from "jsr:@zuke/git@^1";
class Release extends Build {
// Not `version`: that renders as `--version`, which Zuke reserves for
// reporting its own version.
releaseVersion = parameter("The version to release, e.g. 1.1.0").required();
clean = target()
.description("Refuse to release from a dirty working tree")
.executes(async () => {
// `$` still works inside a target — handy for a one-off command that
// has no wrapper, or before you have looked for one.
const dirty = await $`git status --porcelain`.quiet().text();
if (dirty !== "") throw new Error("the working tree is not clean");
});
test = target()
.description("Run the tests")
.dependsOn(this.clean)
.executes(() => DenoTasks.test((s) => s.allowAll().paths(".")));
tag = target()
.description("Create the annotated release tag")
.dependsOn(this.test)
.executes(() =>
GitTasks.tag((s) =>
s.name(`v${this.releaseVersion.value}`)
.message(`Release ${this.releaseVersion.value}`)
)
);
push = target()
.description("Push the tag")
.dependsOn(this.tag)
.executes(() => GitTasks.push((s) => s.remote("origin").followTags()));
default = target()
.description("Default: the whole release")
.dependsOn(this.push)
.executes(() => {});
}
await run(Release);

Xet Storage Details

Size:
1.99 kB
·
Xet hash:
dfa768c371897f323073077492ba91c84f915cd46c15527f5c3b4b1038ac01bf

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.