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
17 changes: 13 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
npm:
needs: verify
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 15
environment: npm
permissions:
contents: read
Expand All @@ -85,11 +85,20 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
if npm view "@pymodel/designer-skill-mcp@${TAG#v}" version >/dev/null 2>&1; then
echo "already on npm; skipping"
else
published() { npm view "@pymodel/designer-skill-mcp@${TAG#v}" version >/dev/null 2>&1; }
if [ -n "$NODE_AUTH_TOKEN" ]; then
if published; then echo "already on npm; skipping"; exit 0; fi
npm publish ./pkg/*.tgz --provenance --access public --ignore-scripts
exit 0
fi
# No token: release.sh PUBLISH_LOCAL=1 published it; npm processes uploads
# asynchronously, so wait for the version instead of racing it.
for _ in $(seq 60); do
if published; then echo "published locally; skipping"; exit 0; fi
sleep 10
done
echo "::error::${TAG#v} not on npm after 10 min and no NPM_TOKEN secret to publish it"
exit 1

registry:
needs: npm
Expand Down
Loading