Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,21 @@ jobs:
echo "$NAME@$VERSION is already on the registry - nothing to do"
exit 0
fi
if npm publish --provenance --access public; then
out="$RUNNER_TEMP/publish.log"
if npm publish --provenance --access public >"$out" 2>&1; then
cat "$out"
echo "published $NAME@$VERSION"
exit 0
fi
cat "$out"
# npm view lags a publish by minutes: right after the first version
# went out by hand, it still answers 404 while the registry already
# refuses to publish that version again. Measured on 0.1.0: the tag
# run reached this step two minutes after the hand publish.
if grep -q "cannot publish over the previously published version" "$out"; then
echo "$NAME@$VERSION is already on the registry (npm view does not show it yet) - nothing to do"
exit 0
fi
if npm view "$NAME" version >/dev/null 2>&1; then
echo "::error::$NAME is on the registry, but publishing $VERSION failed - see the npm output above (the Trusted Publisher not pointing at this repository and release.yml?)"
exit 1
Expand Down
Loading