Skip to content

ci(release): release-please + provenance npm publishing - #13

Merged
luke-speechify merged 1 commit into
mainfrom
chore/ci-npm-publish
Aug 31, 2026
Merged

ci(release): release-please + provenance npm publishing#13
luke-speechify merged 1 commit into
mainfrom
chore/ci-npm-publish

Conversation

@luke-speechify

Copy link
Copy Markdown
Contributor

Sets up npm publishing CI/CD, replicating the pipeline from the @speechify/api TypeScript SDK (Speechify-AI/sdk-typescript), adapted for this tsup-built CLI.

Workflows

  • release-please.ymlcompile + test on every push/PR; on push to main, release-please opens/updates a release PR; when a release is cut, publish builds and publishes to npm with provenance via OIDC trusted publishing (no NPM token). alpha/beta tags publish to matching dist-tags. (This PR itself runs the compile + test jobs.)
  • manual-publish.ymlworkflow_dispatch fallback for a tagged release whose auto-publish didn't run, and the way to cut the first release.

Guardrails (same philosophy as the SDK)

Before anything reaches npm, the publish job asserts every version-bearing property agrees with the release tag:

  • package.json version
  • the built artifact answering for itself: node dist/bin.js --version
  • repository.url casing (npm provenance rejects a case-inexact URL with HTTP 422)

Adaptations vs. the SDK

  • No Fern stamp step / .fern/metadata.json / dist/cjs|esm assertions — the CLI isn't Fern-generated. tsup bakes the version into dist/bin.js (__CLI_VERSION__) from package.json, so package.json is the single source of truth; nothing needs stamping.
  • Compile job also runs pnpm typecheck (tsup emits without type-checking, whereas the SDK's tsc build type-checks for free).

Versioning (v0)

release-please-config.json enables pre-1.0 semantics:

  • bump-minor-pre-major → breaking changes bump minor (0.1.0 → 0.2.0)
  • bump-patch-for-minor-pre-major → features bump patch (0.1.0 → 0.1.1)

Nothing reaches 1.0.0 until intended.

⚠️ One-time setup required (npm side, only you can do)

Configure a Trusted Publisher for @speechify/cli on npmjs.org → org Speechify-AI, repo cli, workflows release-please.yml and manual-publish.yml. The package is currently unpublished, so the first release should go via manual-publish (ref + expected_version) once the trusted publisher is set.

Validated locally: JSON/YAML parse, pnpm install --frozen-lockfile (lockfile carries Linux keyring binaries), typecheck, build, 210 tests, and the assertion scripts (pass at true tag; refuse wrong tag and wrong repo-casing).

Replicate the release pipeline from the @speechify/api TypeScript SDK,
adapted for this tsup CLI (no Fern-generated version literals).

- release-please.yml: compile + test on push/PR, release-please on push to
  main, then publish with npm provenance (OIDC trusted publishing, no token).
  alpha/beta tags publish to matching dist-tags.
- manual-publish.yml: workflow_dispatch fallback (and the first release).
- Publish asserts every version-bearing property agrees with the release tag:
  package.json, the built `dist/bin.js --version`, and the repository.url
  casing (npm provenance rejects a case-inexact URL with 422).
- release-please-config.json: release-type node, pre-1.0 semantics enabled —
  bump-minor-pre-major + bump-patch-for-minor-pre-major, so breaking changes
  bump minor and features bump patch while on 0.x (nothing jumps to 1.0.0).
- Pin packageManager to pnpm@10.33.4 for corepack.

Requires a one-time npm trusted-publisher config for @speechify/cli
(GitHub Actions, repo Speechify-AI/cli). First publish goes via manual-publish.
@luke-speechify
luke-speechify merged commit 7eab4fe into main Aug 31, 2026
4 checks passed
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