Skip to content

Commit 28298bd

Browse files
committed
More deploy script faff
1 parent 9847e81 commit 28298bd

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

deploy/deployChangedPackages.mjs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Assuming that this means we need to upload this package.`);
6666
if (upload) {
6767
if (process.env.NODE_AUTH_TOKEN) {
6868
const publish = spawnSync("npm", ["publish", "--access", "public"], {
69-
cwd: join(generatedDir, "packages", dirName),
69+
cwd: join(generatedDir, dirName),
7070
stdio: "inherit",
7171
});
7272

@@ -79,6 +79,11 @@ Assuming that this means we need to upload this package.`);
7979

8080
await createRelease(`${pkgJSON.name}@${pkgJSON.version}`);
8181
}
82+
} else {
83+
console.log(
84+
"Wanting to run: 'npm publish --access public' in " +
85+
join(generatedDir, dirName)
86+
);
8287
}
8388

8489
uploaded.push(dirName);
@@ -103,12 +108,18 @@ async function createRelease(tag) {
103108
const authToken = process.env.GITHUB_TOKEN || process.env.GITHUB_API_TOKEN;
104109
const octokit = new Octokit({ auth: authToken });
105110

106-
await octokit.request("POST /repos/{owner}/{repo}/releases", {
107-
owner: "microsoft",
108-
repo: "TypeScript-DOM-lib-generator",
109-
tag_name: tag,
110-
target_commitish: process.env.GITHUB_SHA,
111-
});
111+
try {
112+
await octokit.request("POST /repos/{owner}/{repo}/releases", {
113+
owner: "microsoft",
114+
repo: "TypeScript-DOM-lib-generator",
115+
tag_name: tag,
116+
target_commitish: process.env.GITHUB_SHA,
117+
});
118+
} catch (error) {
119+
console.error(
120+
"Creating the GitHub release failed, this is likely due to re-running the deploy."
121+
);
122+
}
112123
}
113124

114125
go();

0 commit comments

Comments
 (0)