forked from withcatai/node-llama-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrerunSemanticReleaseGithubSuccess.ts
38 lines (32 loc) · 1.38 KB
/
rerunSemanticReleaseGithubSuccess.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import path from "path";
import {fileURLToPath} from "url";
import fs from "fs-extra";
// @ts-ignore
import {verifyConditions as githubVerifyConditions, success as githubSuccess} from "@semantic-release/github";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const brokenReleaseDryRunResult = fs.readJSONSync(path.join(__dirname, "resolved-next-release-artifact", "semanticReleaseDryRunReleaseResult.json"));
console.log("Broken release dry run result:", brokenReleaseDryRunResult);
const githubPluginConfig = {};
const context = {
...brokenReleaseDryRunResult,
options: {
repositoryUrl: "https://github.com/withcatai/node-llama-cpp.git"
},
logger: console,
env: process.env
};
for (const release of context.releases) {
if (release.pluginName === "@semantic-release/npm") {
if (release.url == null) {
release.name = "npm package (@latest dist-tag)";
release.url = "https://www.npmjs.com/package/node-llama-cpp/v/" + release.version;
}
} else if (release.pluginName === "@semantic-release/github") {
if (release.url == null) {
release.name = "GitHub release";
release.url = "https://github.com/withcatai/node-llama-cpp/releases/tag/" + release.gitTag;
}
}
}
await githubVerifyConditions(githubPluginConfig, context);
await githubSuccess(githubPluginConfig, context);