1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

chore(ci): fix Releases.md creation and tag name (#14166)

This commit is contained in:
David Sherret 2022-04-01 11:11:53 -04:00 committed by GitHub
parent 7fec7c834c
commit 8ca4c1819f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 13 deletions

View file

@ -78,17 +78,22 @@ async function getReleasesMdText() {
}
async function getGitLog() {
const lastVersion = semver.parse(originalCliVersion)!;
const lastVersionTag = `v${originalCliVersion}`;
const originalVersion = semver.parse(originalCliVersion)!;
const originalVersionTag = `v${originalCliVersion}`;
// fetch the upstream tags
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
const latestTag = await repo.gitLatestTag();
if (latestTag === lastVersionTag) {
if (latestTag === originalVersionTag) {
return await repo.getGitLogFromTags(
"upstream",
lastVersionTag,
originalVersionTag,
undefined,
);
} else {
@ -96,8 +101,8 @@ async function getGitLog() {
await repo.gitFetchHistory("upstream");
const lastMinorHistory = await repo.getGitLogFromTags(
"upstream",
`v${lastVersion.major}.${lastVersion.minor}.0`,
lastVersionTag,
`v${originalVersion.major}.${originalVersion.minor}.0`,
originalVersionTag,
);
const currentHistory = await repo.getGitLogFromTags(
"upstream",

View file

@ -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.
import { DenoWorkspace } from "./deno_workspace.ts";
@ -8,10 +8,11 @@ const cliCrate = workspace.getCliCrate();
await repo.gitFetchTags("origin");
const tags = await repo.getGitTags();
const tagName = `v${cliCrate.version}`;
if (tags.has(cliCrate.version)) {
console.log(`Tag ${cliCrate.version} already exists.`);
if (tags.has(tagName)) {
console.log(`Tag ${tagName} already exists.`);
} else {
await repo.gitTag(cliCrate.version);
await repo.gitPush(cliCrate.version);
await repo.gitTag(tagName);
await repo.gitPush(tagName);
}

View file

@ -1,4 +1,4 @@
// 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.0/github_actions.ts";
export * from "https://raw.githubusercontent.com/denoland/automation/0.9.2/mod.ts";
export * from "https://raw.githubusercontent.com/denoland/automation/0.9.2/github_actions.ts";