diff --git a/deno.json b/deno.json index 894ab1f..69bed2c 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "imports": { - "automation": "https://raw.githubusercontent.com/dprint/automation/0.8.1/mod.ts", + "automation": "https://raw.githubusercontent.com/dprint/automation/0.9.0/mod.ts", "octokit": "npm:octokit@^3.1" } } diff --git a/scripts/generateReleaseNotes.ts b/scripts/generateReleaseNotes.ts index 533f8c7..50e2fdc 100644 --- a/scripts/generateReleaseNotes.ts +++ b/scripts/generateReleaseNotes.ts @@ -1,4 +1,4 @@ -import { generateChangeLog } from "https://raw.githubusercontent.com/dprint/automation/0.9.0/changelog.ts"; +import { generateChangeLog } from "automation"; const version = Deno.args[0]; const changelog = await generateChangeLog({ diff --git a/scripts/update.ts b/scripts/update.ts index 67a0e89..d118f24 100644 --- a/scripts/update.ts +++ b/scripts/update.ts @@ -20,7 +20,6 @@ $.log("Found new version."); $.logStep("Updating Cargo.toml..."); const isPatchBump = cargoTomlVersion.version.major === latestTag.version.major && cargoTomlVersion.version.minor === latestTag.version.minor; -cargoToml.bumpCargoTomlVersion(isPatchBump ? "patch" : "minor"); cargoToml.replaceAll(cargoTomlVersion.tag, latestTag.tag); // run the tests @@ -31,6 +30,13 @@ if (Deno.args.includes("--skip-publish")) { Deno.exit(0); } +$.logStep(`Committing Biome version bump commit...`); +await $`git add .`; +const message = `${isPatchBump ? "fix" : "feat"}: update to biome ${latestTag.tag}`; +await $`git commit -m ${message}`; + +$.logStep("Bumping version in Cargo.toml..."); +cargoToml.bumpCargoTomlVersion(isPatchBump ? "patch" : "minor"); // release const newVersion = cargoToml.version(); $.logStep(`Committing and publishing ${newVersion}...`); @@ -72,12 +78,12 @@ function tagToVersion(tag: string) { return semver.parse(tag.replace(/^cli\/v/, "")); } -async function getGitTags() { +async function getGitTags(): Promise { const client = new Octokit(); const response = await client.request("GET /repos/{owner}/{repo}/tags", { owner: "biomejs", repo: "biome", per_page: 100, }); - return response.data.map((item) => item.name); + return response.data.map((item: { name: string }) => item.name); }