Refactor/Fix release script (#13619)

This commit is contained in:
fisker Cheung authored and GitHub committed 2022-10-14 17:17:47 +08:00
1 parent 8df3b5ee60
commit 76d0890142
23 files changed
+289 -202

No files matched your search

+28 -22
View File
@@ -2,8 +2,6 @@ import chalk from "chalk";
import outdent from "outdent";
import { waitForEnter, logPromise } from "../utils.js";
const outdentString = outdent.string;
export async function isVersionReleased(version) {
const response = await fetch("https://registry.npmjs.org/prettier/");
const result = await response.json();
@@ -23,8 +21,6 @@ async function checkBotPermission() {
return maintainers.some(({ name }) => name === "prettier-bot");
}
checkBotPermission();
const sleep = () =>
new Promise((resolve) => {
setTimeout(resolve, 30_000);
@@ -37,35 +33,45 @@ export default async function waitForBotRelease({ dry, version }) {
if (!(await checkBotPermission())) {
console.log(
outdentString(chalk/* indent */ `
1. Go to {green.underline https://www.npmjs.com/package/prettier/access}
2. Add "{yellow prettier-bot}" as prettier package maintainer.
Press ENTER to continue.
`)
outdent`
1. Go to ${chalk.green.underline(
"https://www.npmjs.com/package/prettier/access"
)}
2. Add "${chalk.yellow("prettier-bot")}" as prettier package maintainer.
`
);
await waitForEnter();
}
console.log(
outdentString(chalk/* indent */ `
1. Go to {green.underline https://www.npmjs.com/package/prettier/access}
2. Make sure "{yellow Publishing access}" section is set to "{yellow Require two-factor authentication or automation tokens}".
Press ENTER to continue.
`)
outdent`
1. Go to ${chalk.green.underline(
"https://www.npmjs.com/package/prettier/access"
)}
2. Make sure "${chalk.yellow(
"Publishing access"
)}" section is set to "${chalk.yellow(
"Require two-factor authentication or automation tokens"
)}".
`
);
await waitForEnter();
console.log(
outdentString(chalk/* indent */ `
1. Go to {green.underline https://github.com/prettier/release-workflow/actions/workflows/release.yml}
2. Click "{green Run workflow}" button, type "{yellow.underline ${version}}" in "Version to release", uncheck all checkboxes, hit the "{bgGreen Run workflow}" button.
Press ENTER to continue.
`)
outdent`
1. Go to ${chalk.green.underline(
"https://github.com/prettier/release-workflow/actions/workflows/release.yml"
)}
2. Click "${chalk.green(
"Run workflow"
)}" button, type "${chalk.yellow.underline(
version
)}" in "Version to release", uncheck all checkboxes, hit the "${chalk.bgGreen(
"Run workflow"
)}" button.
`
);
await waitForEnter();