Skip to content

feat: scaffold @socketaddon/iocraft publish pipeline#1

Merged
John-David Dalton (jdalton) merged 1 commit into
mainfrom
scaffold-iocraft-publish-pipeline
May 2, 2026
Merged

feat: scaffold @socketaddon/iocraft publish pipeline#1
John-David Dalton (jdalton) merged 1 commit into
mainfrom
scaffold-iocraft-publish-pipeline

Conversation

@jdalton
Copy link
Copy Markdown
Collaborator

Summary

Scaffolds the publish boundary for @socketaddon/iocraft* packages.

  • packages/iocraft — umbrella with optionalDependencies + platform loader (index.mjs/index.d.ts)
  • packages/iocraft-{darwin,linux,win32}-{arm64,x64} (+ linux musl variants) — 8 per-platform shims
  • scripts/publish.mts — download .node from socket-btm GH Releases, verify SHA-256, stage to tmpdir, pnpm publish. Fails loudly on checksum mismatch.
  • .github/workflows/provenance.yml — delegates to the shared socket-registry/.github/workflows/provenance.yml@<sha> reusable with use-trusted-publishing: true
  • docs/trusted-publisher-migration.md — checklist for migrating npm trusted-publisher ownership from SocketDev/socket-cli to SocketDev/socket-addon

Why a separate repo

Trusted publishing on npm requires the OIDC-issuing GitHub repo to match the publish boundary. Splitting build (socket-btm) from publish (socket-addon) means btm's publish credentials don't have npm scope, and socket-cli stops re-publishing iocraft as a side effect of CLI releases.

Verification chain

  1. socket-btm cuts iocraft-<date>-<sha> Release with 8 .node files + checksums.txt
  2. Bump tag + checksums in packages/build-infra/release-assets.json
  3. scripts/publish.mts downloads each .node, runs verifyReleaseChecksum against the embedded SHA-256, copies into staged tmpdir, publishes

If a checksum mismatches, the run aborts before any package is published. No silent fallthrough.

Test plan

  • pnpm install succeeds
  • pnpm run publish:dry stages all 9 packages, downloads + verifies all 8 binaries, reports --- 9 packages will be published
  • After merge: trigger workflow with dist-tag = pre, confirm 9 packages published
  • Install verification: npm install @socketaddon/iocraft@pre resolves the matching per-platform package and import iocraft from '@socketaddon/iocraft' works
  • Once stable, follow docs/trusted-publisher-migration.md to remove SocketDev/socket-cli as a trusted publisher

- packages/iocraft: umbrella with optionalDependencies + platform loader
  (index.mjs / index.d.ts). The loader uses raw process.platform names,
  so @socketaddon/iocraft-win32-{arm64,x64} now match (previous shim
  remapped win32 -> 'win' to match the old win-* package names).

- packages/iocraft-{darwin-arm64,darwin-x64,linux-arm64,linux-arm64-musl,
  linux-x64,linux-x64-musl,win32-arm64,win32-x64}: per-platform shims.
  Each declares os/cpu/libc constraints so npm only installs the
  matching one. iocraft.node is NOT in the working tree — the publish
  script downloads + verifies it at publish time.

- scripts/publish.mts: download-verify-publish orchestrator.
  - Reads release-assets.json for the iocraft tag + checksums.
  - For each per-platform package: stages to tmpdir, downloads
    iocraft-<tag>-<asset-suffix>.node from socket-btm GH Releases,
    verifyReleaseChecksum (fail loudly on mismatch), copies into the
    stage as iocraft.node, runs `pnpm publish` from the stage with
    --access public --no-git-checks --ignore-scripts (+ --provenance
    in CI). Working tree never receives the binary.
  - Umbrella publishes last (its optionalDependencies must resolve).
  - Skip-if-already-published, --dry-run, --force, --platforms=,
    --skip-umbrella all supported.

- .github/workflows/provenance.yml: delegates to
  socket-registry/.github/workflows/provenance.yml@<sha> reusable
  with publish-script: 'publish:ci' and use-trusted-publishing: true.
  No setup-script — packages are static; binaries arrive at publish.

- docs/trusted-publisher-migration.md: step-by-step npm UI checklist
  for moving the trusted-publisher binding from SocketDev/socket-cli
  to SocketDev/socket-addon (one-time migration).
@jdalton John-David Dalton (jdalton) merged commit 88682d0 into main May 2, 2026
5 checks passed
@jdalton John-David Dalton (jdalton) deleted the scaffold-iocraft-publish-pipeline branch May 2, 2026 15:38
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