Skip to content

fix(ci): publish via npx and tag prereleases explicitly#78

Merged
zhawtof merged 1 commit into
mainfrom
fix/publish-npx-and-prerelease-tag
May 20, 2026
Merged

fix(ci): publish via npx and tag prereleases explicitly#78
zhawtof merged 1 commit into
mainfrom
fix/publish-npx-and-prerelease-tag

Conversation

@zhawtof
Copy link
Copy Markdown
Contributor

@zhawtof zhawtof commented May 20, 2026

Summary

Two issues blocked the publish step on top of #76:

  1. npm install -g npm@latest race. npm tries to overwrite its own files mid-install — the in-flight install removes promise-retry from the bundled @npmcli/arborist before the new files settle, and the still-running npm crashes with MODULE_NOT_FOUND. This is what the 0.8.1 re-run hit.
    • Fix: use npx -y npm@latest publish instead. npx caches to ~/.npm/_npx/ — no self-overwrite. Same OIDC trusted-publisher behavior because the resolved CLI is the same.
  2. npm 11+ requires --tag for prereleases. Doesn't affect 0.8.1 (stable), but the next time release-please cuts a -alpha.N it will: "You must specify a tag using --tag when publishing a prerelease version."
    • Fix: derive the tag from the version's prerelease identifier; stable versions still publish to latest (default).

Mirrors TightknitAI/slack-block-kit-validator#35.

Test plan

  • Merge.
  • Re-run the 0.8.1 release-please workflow (or wait for the next release PR).
  • Confirm 0.8.1 lands on npm with provenance.

🤖 Generated with Claude Code

Two issues showed up running the trusted-publisher publish step:

- `npm install -g npm@latest` races against the running bundled npm
  ("Cannot find module 'promise-retry'") because npm tries to overwrite
  its own files mid-install. Run the modern CLI via `npx` from its
  separate cache instead — no self-overwrite, same OIDC behavior.
- npm 11+ refuses to publish a prerelease without `--tag`:
  "You must specify a tag using --tag when publishing a prerelease
  version." Derive the tag from the version's prerelease identifier
  so future prereleases (e.g. `-alpha.N`) land on the matching tag
  rather than getting bounced. Stable versions still publish to
  `latest` (default).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
block-kitchen 7361e4d Commit Preview URL

Branch Preview URL
May 20 2026, 07:14 AM

@zhawtof zhawtof merged commit 7475c86 into main May 20, 2026
13 checks passed
@zhawtof zhawtof deleted the fix/publish-npx-and-prerelease-tag branch May 20, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant