8000 Publish jetdb-wasm to npm on release, and let the npm publishing be tried by hand by dominion525 · Pull Request #119 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Publish jetdb-wasm to npm on release, and let the npm publishing be tried by hand - #119

Merged
dominion525 merged 6 commits into
mainfrom
ci/npm-publish
Oct 23, 2026
Merged

dominion525 merged 6 commits into
mainfrom
ci/npm-publish

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • Add a job to the release workflow that builds and tests jetdb-wasm and publishes it to npm, after the GitHub release of a tag, beside the crates. It authenticates through npm Trusted Publishing, with no token stored, and needs the package to be on npm, published once by hand, so that the trusted publisher can be configured on its page
  • Publish a prerelease, a version with a -, under the next tag, so that it does not become the version npm installs, as the GitHub release marks it a prerelease
  • Go on to publish only when npm view says E404 for the version: skip a version already on npm on a tag, and stop on any other failure of npm view
  • Add a workflow_dispatch trigger that takes a version and runs the npm job alone, to try the publishing without a release. It runs only from main, which CI has tested, and fails when the version is on npm already
  • Check the version of jetdb-wasm in its Cargo.toml against the tag too

🤖 Generated with Claude Code

dominion525 and others added 6 commits October 23, 2026 03:12
…ried by hand

- Add a job that publishes jetdb-wasm to npm after the GitHub release of a tag, beside the crates, through Trusted Publishing with no token stored, unless the version is on npm already
- Add a workflow_dispatch trigger that takes a version and runs the npm job alone
- Check the version of jetdb-wasm in its Cargo.toml against the tag too

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- A tag such as v0.4.0-rc.1 made a prerelease on GitHub, but went to npm as latest
- Publish a version with a - in it under the next tag

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The workflow_dispatch trigger could publish a real version to npm from any branch, with no tests, and npm never lets a version be used again, so a trial could take the place of a release
- Stop with the reason when it is run by hand from anything but main, which CI has tested

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Any failure of npm view was taken to mean the version is not on npm, so a network or auth failure led on to a publish, and a run by hand with a version already on npm ended green with nothing published
- Go on to publish only on E404, stop with the output of npm on any other failure, and fail a run by hand whose version is on npm already

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Unlike the other Rust jobs, the npm job built jetdb for Wasm from scratch every time
- Add Swatinem/rust-cache

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Trusted Publishing is configured on the page of the package on npm, so it cannot be for jetdb-wasm, which is not on npm yet, and the first publish cannot go through this job
- Say in the comment of the workflow that the package has to be published once by hand before this job can publish to it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@dominion525
dominion525 merged commit 201879b into main Oct 23, 2026
10 checks passed
@dominion525
dominion525 deleted the ci/npm-publish branch October 23, 2026 05:34
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

0