@orderly.network/npm-release 0.0.2-alpha.6 → 0.0.2-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +10 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -94,12 +94,19 @@ function getPackagePageUrl(pkgName) {
|
|
|
94
94
|
async function sendSlackNotify({ success, error }) {
|
|
95
95
|
if (!slackWebhookUrl) return;
|
|
96
96
|
|
|
97
|
+
const raw = npm.registry || "https://registry.npmjs.org";
|
|
98
|
+
const registry = raw.replace(/\/$/, "");
|
|
99
|
+
const isPublic = !npm.registry || registry === "https://registry.npmjs.org";
|
|
100
|
+
const registryLabel = isPublic ? "public" : "internal";
|
|
101
|
+
|
|
97
102
|
const { name: pkgName, version } = readPackageJson();
|
|
98
103
|
const packageUrl = getPackagePageUrl(pkgName);
|
|
99
104
|
const linkedPkg = `<${packageUrl}|${pkgName}@${version}>`;
|
|
100
105
|
const text = success
|
|
101
|
-
? `packages published successfully:\n${linkedPkg}`
|
|
102
|
-
: `packages publish failed:\n${linkedPkg}\n${
|
|
106
|
+
? `packages published successfully (${registryLabel} registry):\n${linkedPkg}`
|
|
107
|
+
: `packages publish failed (${registryLabel} registry):\n${linkedPkg}\n${
|
|
108
|
+
error || "Unknown error"
|
|
109
|
+
}`;
|
|
103
110
|
|
|
104
111
|
try {
|
|
105
112
|
const res = await fetch(slackWebhookUrl, {
|
|
@@ -236,6 +243,7 @@ async function main() {
|
|
|
236
243
|
|
|
237
244
|
await sendSlackNotify({ success: true });
|
|
238
245
|
} catch (err) {
|
|
246
|
+
console.error("release error: ", err);
|
|
239
247
|
await sendSlackNotify({
|
|
240
248
|
success: false,
|
|
241
249
|
error: err?.message,
|