Skip to content

feat(release): publish the CLI to npm with semantic-release; CI and Dependabot - #5

Merged
Domantas merged 4 commits into
mainfrom
chore/release-setup
Sep 16, 2026
Merged

Domantas merged 4 commits into
mainfrom
chore/release-setup

Conversation

@Domantas

@Domantas Domantas commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Sets up automated npm releases for @norbix.ai/cli, using what we learned from norbix-js (sdk-ts #40–#43) and norbix-net (sdk-net #53).

1. norbix.dev → norbix.ai (from #4): package.json homepage and RESEARCH.md. No norbix.dev remains.

2. Tooling (package.json / lockfile)

  • semantic-release 25.0.9, commit-analyzer 13, release-notes-generator 14, npm 13, github 12.
  • conventional-changelog-conventionalcommits pinned to ^9: v10 breaks release notes with release-notes-generator 14.x ("Missing helper"), which failed both other repos' releases.
  • npm audit fix (brace-expansion, high): 0 vulnerabilities. Lockfile verified with npm@10 ci and npm@11 ci.

3. Windows test fix: tests/_helpers.ts built the CLI root from URL.pathname, which yields /D:/a/... on Windows, so 25 of 42 tests failed there. It now uses fileURLToPath.

4. Workflows: the drafts in github-workflows/ never ran, so they move to .github/workflows.

  • ci.yml: Node 20/22/24 × Linux/macOS/Windows: typecheck, build, --help smoke test; tests on Node 22+ (vitest 5 needs ^22.12). A package job checks the tarball (oclif manifest included, no src/tests) and runs npm audit.
  • release.yml: semantic-release on push to main (and next / beta prereleases), replacing manual npm version tags.
    • Publishes via npm trusted publishing (OIDC) with provenance; the runner gets npm 11. NPM_TOKEN is only a fallback: npm now requires 2FA (OTP) for token-based publishes, which failed sdk-ts's release.
    • No commit back to protected main: package.json version stays stale; tags and GitHub Releases are the source of truth.
    • workflow_dispatch with republish=true recovers a tag whose npm publish failed.
  • .releaserc.json: same rules as norbix-js. dependabot.yml: weekly npm + Actions updates with conventional prefixes.

Version baseline

There were no git tags, so semantic-release would have published 1.0.0. Tag v0.1.0 now marks e069209, the earliest commit, which matches the published 0.1.0 (published a day before the git history starts). Commits since then aren't conventional, so this PR's squash title decides the release: feat(release): … → 0.2.0, which ships everything added since 0.1.0 (files publish/unpublish, push commands, …). To not release yet, retitle it ci: ….

Before merging: npmjs.com (maintainer)

@norbix.ai/cli → Settings → Trusted Publisher → GitHub Actions: organization norbix-code, repository cli, workflow release.yml, environment empty.

Test plan

  • typecheck, 42 tests, --help smoke, package check, npm audit: all pass locally
  • Real analyzeCommits + generateNotes since v0.1.0: no release as-is; with this PR's title → 0.2.0 notes
  • CI matrix: Node 20/22/24 × Linux/macOS/Windows + package job, all green
  • After merge: 0.2.0 on npm with provenance, tag v0.2.0, GitHub Release

🤖 Generated with Claude Code

Domantas and others added 4 commits September 16, 2026 17:18
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…finding

- semantic-release 25.0.9 with commit-analyzer 13, release-notes-generator 14,
  @semantic-release/npm 13 and @semantic-release/github 12.
- conventional-changelog-conventionalcommits pinned to ^9: v10 needs
  conventional-changelog-writer@9, but release-notes-generator 14.x ships
  writer 8 (the norbix-js and norbix-net releases failed on exactly this).
- npm audit fix (brace-expansion, high). npm audit: 0.
- Lockfile verified with npm@10 ci and npm@11 ci (CI's Node 22 bundles npm 10).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Move the draft workflows from github-workflows/ into .github/workflows so
  they actually run.
- ci.yml: Node 20/22/24 on Linux, macOS, Windows; typecheck, build and a
  --help smoke test everywhere, tests on Node 22+ (vitest 5 needs ^22.12 ||
  >=24). Package job checks the tarball (oclif manifest present, no src/tests)
  and runs npm audit.
- release.yml: semantic-release on push to main/next/beta instead of manual
  version tags. Publishes with npm trusted publishing (OIDC, npm 11 on the
  runner) and provenance; NPM_TOKEN only as a fallback. No commit back to the
  protected main. workflow_dispatch republish=true recovers a tag whose npm
  publish failed.
- .releaserc.json: same release rules as norbix-js.
- dependabot.yml: weekly npm + GitHub Actions updates with conventional commit
  prefixes; ignores the changelog preset >= 10.
- ROADMAP.md: describe the automated release.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
new URL('..', import.meta.url).pathname yields '/D:/a/cli/cli/' on Windows,
so oclif's Config.load could not find package.json and 25 of 42 tests failed
on the Windows CI runners.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Domantas
Domantas merged commit 399d6e7 into main Sep 16, 2026
10 checks passed
Domantas added a commit that referenced this pull request Sep 16, 2026
After #5 merged, docs PRs landed seconds later; the run for an earlier SHA
logged "The local branch main is behind the remote one, therefore a new
version won't be published". Fetch and reset to origin/<branch> first, as
norbix-js's release job does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant