From ce8ed83e7d3e0f7ec051f58c058c6ac25d7292ef Mon Sep 17 00:00:00 2001 From: Simon Lecoq <22963968+lowlighter@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:17:18 -0500 Subject: [PATCH] ci: write version bumps --- .github/tools/bump_versions.ts | 4 ++-- deno.jsonc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/tools/bump_versions.ts b/.github/tools/bump_versions.ts index 3a32915..1a61050 100644 --- a/.github/tools/bump_versions.ts +++ b/.github/tools/bump_versions.ts @@ -8,7 +8,7 @@ const log = new Logger() /** Bump packages version and print changelogs. */ if (import.meta.main) { - const { write } = parseArgs(Deno.args, { boolean: ["write"] }) + const { "dry-run": dryrun } = parseArgs(Deno.args, { boolean: ["dry-run"] }) // Compute scopes const scopes = [...await Array.fromAsync<{ name: string }>(Deno.readDir("@mizu"))] @@ -44,7 +44,7 @@ if (import.meta.main) { // Bump package versions for (const scope of [...scopes, "internal", "render"]) { log.with({ directive: scope }).debug("checking") - const { version, changelog } = git.changelog(`@mizu/${scope}/deno.jsonc`, { write, scopes: [scope, "internal", ...(scope === "render" ? render.scopes : [])] }) + const { version, changelog } = git.changelog(`@mizu/${scope}/deno.jsonc`, { write: !dryrun, scopes: [scope, "internal", ...(scope === "render" ? render.scopes : [])] }) if (version.bump) { changelog.split("\n").map((line) => log.with({ directive: scope }).info(line)) log.with({ directive: scope }).ok(`${semver.format(version.current)} → ${semver.format(version.next)}`) diff --git a/deno.jsonc b/deno.jsonc index 75e4aa3..41964be 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -94,7 +94,7 @@ }, "ci:bump-versions": { "description": "Bump versions based on each package changes", - "command": "LOG_LEVEL=debug deno run --allow-read=@mizu --allow-write=$(deno task resolve:glob \"@mizu/**/deno.jsonc\") --allow-env --allow-run=git .github/tools/bump_versions.ts" + "command": "deno run --allow-read=@mizu --allow-write=$(deno task resolve:glob \"@mizu/**/deno.jsonc\") --allow-env --allow-run=git .github/tools/bump_versions.ts" }, "ci:autogenerate": { "description": "Autogenerate files",