mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
chore(ci): fix Releases.md creation and tag name (#14166)
This commit is contained in:
parent
7fec7c834c
commit
8ca4c1819f
3 changed files with 19 additions and 13 deletions
|
@ -78,17 +78,22 @@ async function getReleasesMdText() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getGitLog() {
|
async function getGitLog() {
|
||||||
const lastVersion = semver.parse(originalCliVersion)!;
|
const originalVersion = semver.parse(originalCliVersion)!;
|
||||||
const lastVersionTag = `v${originalCliVersion}`;
|
const originalVersionTag = `v${originalCliVersion}`;
|
||||||
// fetch the upstream tags
|
// fetch the upstream tags
|
||||||
await repo.gitFetchTags("upstream");
|
await repo.gitFetchTags("upstream");
|
||||||
|
|
||||||
|
// make the repo unshallow so we can fetch the latest tag
|
||||||
|
if (await repo.gitIsShallow()) {
|
||||||
|
await repo.gitFetchUnshallow("origin");
|
||||||
|
}
|
||||||
|
|
||||||
// this means we're on the patch release
|
// this means we're on the patch release
|
||||||
const latestTag = await repo.gitLatestTag();
|
const latestTag = await repo.gitLatestTag();
|
||||||
if (latestTag === lastVersionTag) {
|
if (latestTag === originalVersionTag) {
|
||||||
return await repo.getGitLogFromTags(
|
return await repo.getGitLogFromTags(
|
||||||
"upstream",
|
"upstream",
|
||||||
lastVersionTag,
|
originalVersionTag,
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -96,8 +101,8 @@ async function getGitLog() {
|
||||||
await repo.gitFetchHistory("upstream");
|
await repo.gitFetchHistory("upstream");
|
||||||
const lastMinorHistory = await repo.getGitLogFromTags(
|
const lastMinorHistory = await repo.getGitLogFromTags(
|
||||||
"upstream",
|
"upstream",
|
||||||
`v${lastVersion.major}.${lastVersion.minor}.0`,
|
`v${originalVersion.major}.${originalVersion.minor}.0`,
|
||||||
lastVersionTag,
|
originalVersionTag,
|
||||||
);
|
);
|
||||||
const currentHistory = await repo.getGitLogFromTags(
|
const currentHistory = await repo.getGitLogFromTags(
|
||||||
"upstream",
|
"upstream",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env -S deno run --allow-read --allow-write --allow-run=cargo --no-check
|
#!/usr/bin/env -S deno run --allow-read --allow-write --allow-run=cargo,git --no-check
|
||||||
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
||||||
import { DenoWorkspace } from "./deno_workspace.ts";
|
import { DenoWorkspace } from "./deno_workspace.ts";
|
||||||
|
|
||||||
|
@ -8,10 +8,11 @@ const cliCrate = workspace.getCliCrate();
|
||||||
|
|
||||||
await repo.gitFetchTags("origin");
|
await repo.gitFetchTags("origin");
|
||||||
const tags = await repo.getGitTags();
|
const tags = await repo.getGitTags();
|
||||||
|
const tagName = `v${cliCrate.version}`;
|
||||||
|
|
||||||
if (tags.has(cliCrate.version)) {
|
if (tags.has(tagName)) {
|
||||||
console.log(`Tag ${cliCrate.version} already exists.`);
|
console.log(`Tag ${tagName} already exists.`);
|
||||||
} else {
|
} else {
|
||||||
await repo.gitTag(cliCrate.version);
|
await repo.gitTag(tagName);
|
||||||
await repo.gitPush(cliCrate.version);
|
await repo.gitPush(tagName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
export * from "https://raw.githubusercontent.com/denoland/automation/0.9.0/mod.ts";
|
export * from "https://raw.githubusercontent.com/denoland/automation/0.9.2/mod.ts";
|
||||||
export * from "https://raw.githubusercontent.com/denoland/automation/0.9.0/github_actions.ts";
|
export * from "https://raw.githubusercontent.com/denoland/automation/0.9.2/github_actions.ts";
|
||||||
|
|
Loading…
Reference in a new issue