@wipcomputer/deploy-public 1.9.68 → 1.9.69
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/deploy-public.sh +41 -2
- package/package.json +1 -1
package/deploy-public.sh
CHANGED
|
@@ -227,10 +227,44 @@ if [[ -n "${VERSION:-}" ]]; then
|
|
|
227
227
|
if [[ -n "$NPM_TOKEN" ]]; then
|
|
228
228
|
cd "$NPM_TMPDIR/public"
|
|
229
229
|
|
|
230
|
+
# Helper: classify an npm publish failure and print a real message.
|
|
231
|
+
# Distinguishes the "already published" no-op case from real errors so
|
|
232
|
+
# the output is not buried in 10+ misleading "non-fatal" lines per run.
|
|
233
|
+
# Related: ai/product/bugs/release-pipeline/2026-04-05--cc-mini--release-pipeline-master-plan.md Phase 7
|
|
234
|
+
classify_npm_publish_error() {
|
|
235
|
+
local pkg_name="$1"
|
|
236
|
+
local err_text="$2"
|
|
237
|
+
if [[ "$err_text" == *"previously published"* || "$err_text" == *"cannot publish over"* ]]; then
|
|
238
|
+
echo " - $pkg_name: already at current version, skipped"
|
|
239
|
+
elif [[ "$err_text" == *"ENEEDAUTH"* || "$err_text" == *"need auth"* ]]; then
|
|
240
|
+
echo " ✗ $pkg_name: auth failed (token missing or invalid)"
|
|
241
|
+
echo " ${err_text##*$'\n'}"
|
|
242
|
+
elif [[ "$err_text" == *"ENETWORK"* || "$err_text" == *"ECONNREFUSED"* ]]; then
|
|
243
|
+
echo " ✗ $pkg_name: network error"
|
|
244
|
+
echo " ${err_text##*$'\n'}"
|
|
245
|
+
elif [[ -n "$err_text" ]]; then
|
|
246
|
+
# Unknown failure: print the first real error line (skip stack dumps)
|
|
247
|
+
local first_err
|
|
248
|
+
first_err=$(echo "$err_text" | grep -E '^npm (error|err!|ERR!) ' | head -1)
|
|
249
|
+
if [[ -z "$first_err" ]]; then
|
|
250
|
+
first_err=$(echo "$err_text" | head -1)
|
|
251
|
+
fi
|
|
252
|
+
echo " ✗ $pkg_name: publish failed"
|
|
253
|
+
echo " ${first_err}"
|
|
254
|
+
else
|
|
255
|
+
echo " ✗ $pkg_name: publish failed (no error text captured)"
|
|
256
|
+
fi
|
|
257
|
+
}
|
|
258
|
+
|
|
230
259
|
# Publish root package (if not private)
|
|
231
260
|
if [[ "$IS_PRIVATE" != "true" ]]; then
|
|
232
261
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
|
|
233
|
-
npm publish --access public 2
|
|
262
|
+
ROOT_PUBLISH_ERR=$(npm publish --access public 2>&1)
|
|
263
|
+
if [[ $? -eq 0 ]]; then
|
|
264
|
+
echo " ✓ Published root package to npm"
|
|
265
|
+
else
|
|
266
|
+
classify_npm_publish_error "root" "$ROOT_PUBLISH_ERR"
|
|
267
|
+
fi
|
|
234
268
|
rm -f .npmrc
|
|
235
269
|
else
|
|
236
270
|
echo " - Root package is private. Skipping root npm publish."
|
|
@@ -244,7 +278,12 @@ if [[ -n "${VERSION:-}" ]]; then
|
|
|
244
278
|
if [[ "$TOOL_PRIVATE" != "true" ]]; then
|
|
245
279
|
TOOL_NAME=$(node -p "require('./${TOOL_DIR}package.json').name" 2>/dev/null)
|
|
246
280
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "${TOOL_DIR}.npmrc"
|
|
247
|
-
(cd "$TOOL_DIR" && npm publish --access public 2
|
|
281
|
+
TOOL_PUBLISH_ERR=$(cd "$TOOL_DIR" && npm publish --access public 2>&1)
|
|
282
|
+
if [[ $? -eq 0 ]]; then
|
|
283
|
+
echo " ✓ Published $TOOL_NAME to npm"
|
|
284
|
+
else
|
|
285
|
+
classify_npm_publish_error "$TOOL_NAME" "$TOOL_PUBLISH_ERR"
|
|
286
|
+
fi
|
|
248
287
|
rm -f "${TOOL_DIR}.npmrc"
|
|
249
288
|
fi
|
|
250
289
|
fi
|
package/package.json
CHANGED