PUBLISHING — NPM CHECKLIST (NOT DONE; OWNER DECIDES)
sdk-v2/PUBLISHING.md · commit 96368332 · GLI CSR §2.2: Distribution · ← package index · raw on GitHub ↗Publishing — NOT done; owner decides the scope
Nothing here has been published. The packages are named @rain/* as a placeholder. If @rain is not yours on npm, pick a scope
(e.g. @rain-risk-markets, @rainrng) and do a search-and-replace of @rain/ across packages/*/package.json,
packages/*/src/**, packages/*/test/**, examples/**, docs/**, README.md before step 2.
0. Preconditions
npm whoami # logged in to the right account/org
npm access ls-packages <org> # scope exists / you have publish rights
npm test && npm run test:live # green
node scripts/vendor-sync.mjs --check
git status --porcelain # clean
1. Version (all five move together — they pin each other by exact version)
npm version 2.0.0 --workspaces --no-git-tag-version
git commit -am "sdk-v2: release 2.0.0" && git tag sdk-v2.0.0
2. Dry run, then publish in dependency order
for p in rng-core rng-session games channels markets; do (cd packages/$p && npm publish --dry-run --access public); done
cd packages/rng-core && npm publish --access public && cd ../..
cd packages/rng-session && npm publish --access public && cd ../..
cd packages/games && npm publish --access public && cd ../..
cd packages/channels && npm publish --access public && cd ../..
cd packages/markets && npm publish --access public && cd ../..
files in each package.json ships only dist/ (+ vendor/, contracts/, abi/, docs where relevant). @rain/games ships ~450 KB of vendored engines; that is intentional (byte-identity is the feature).
3. Provenance / verification (recommended)
npm publish --access public --provenance # from GitHub Actions with id-token: write
Then publish the tag + packages/games/vendor/MANIFEST.json sha256s alongside the Sourcify links in deployments.ts so integrators can tie the npm tarball to the on-chain engineHash.
4. After publishing
- Replace
"@rain/rng-core": "2.0.0"etc. inexamples/agent-dice/package.jsonwith the published scope if renamed. - Announce the attribution term plainly in the npm README (it is in each package README already).
- Do not publish
sdk/(v0.1, private) — superseded.
5. Pre-publication checklist — state on 2026-09-14 (review round 1, item 7a)
Not published. One command away; the owner decides scope and timing.
| check | result |
|---|---|
npm pack --dry-run @rain/rng-core |
OK — 24 files, 21.8 kB packed / 100.1 kB unpacked (dist/ cjs+esm+d.ts, README) |
npm pack --dry-run @rain/rng-session |
OK — 13 files, 20.8 kB / 106.9 kB (dist/, contracts/, README) |
npm pack --dry-run @rain/rng-node |
OK — 34 files, 35.4 kB / 110.1 kB (dist/, bin/, docker/, compose files, README) |
name availability GET https://registry.npmjs.org/@rain%2frng-core |
404 — the package name is free; likewise @rain/rng-session, @rain/rng-node (404, 2026-09-14T06:22Z) |
scope @rain |
no package is published under @rain/ (registry search scope:rain → 0 results). Whether the org/user rain exists cannot be read anonymously (npmjs.com returns 403 to bots); if npm access ls-packages rain says the scope belongs to someone else, use an alternative scope |
| alternative scopes checked (all free, 404) | @rain-risk-markets/*, @rainriskmarkets/* (also @rain-rng/*, @rainrng/*) |
| provenance | publish from GitHub Actions with permissions: id-token: write and npm publish --access public --provenance — Sigstore attestation ties the tarball to the repository + commit; consumers verify with npm audit signatures |
| README attribution term, LICENSE in each tarball | present |
Exact commands (after npm login to the chosen org and the version bump in §1):
# 0. choose scope: if @rain is not yours → grep -rl '@rain/' packages examples docs README.md | xargs sed -i 's#@rain/#@rain-risk-markets/#g'
for p in rng-core rng-session rng-node; do (cd packages/$p && npm pack --dry-run); done
cd packages/rng-core && npm publish --access public --provenance && cd ../..
cd packages/rng-session && npm publish --access public --provenance && cd ../..
cd packages/rng-node && npm publish --access public --provenance && cd ../..
npm view @rain/rng-core dist.integrity # record in the release notes and hand to the lab with lab/FINGERPRINTS.json
Python: packages/rng-py → python -m build && twine upload dist/* under the name rain-rng (PyPI availability not checked; verify with pip index versions rain-rng).
← Back to the package index · Rendered 2026-09-14 09:34 UTC from the repository copy; the markdown in the zip / repo is the document of record.