Skip to content

ci: add CI checks and tag-driven npm release with provenance - #1

Merged
Rinai-R merged 1 commit into
mainfrom
chore/ci
Nov 11, 2026
Merged

Rinai-R merged 1 commit into
mainfrom
chore/ci

Conversation

@Rinai-R

@Rinai-R Rinai-R commented Nov 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds CI for pull requests and main, plus a tag-driven release that publishes to npm with provenance and creates a GitHub Release. Also fixes the pnpm workspace file so pnpm install --frozen-lockfile && pnpm run build && pnpm test works locally and on CI.

Changes

  • .github/workflows/ci.yml runs on pushes to main and on PRs, on Node 22 with pnpm taken from packageManager:

    • typecheck, build, test;
    • node scripts/contract.mjs against the public npm packages of DSH 0.2.1-rc.5 and 0.2.2-rc.1;
    • a reproducible-build check: two clean builds must produce byte-identical dist/;
    • npm pack --dry-run.
  • .github/workflows/release.yml runs on v* tags only, modelled on dsh-labs/dsh-agent-scheduler:

    1. checks that the tag equals the package.json version;
    2. checks that .github/release-notes/<tag>.md has ## Highlights / ## Breaking changes / ## Fixes / ## Compatibility;
    3. reruns all CI checks;
    4. runs npm publish --provenance --access public, with tag next for versions containing - and latest otherwise, and NODE_AUTH_TOKEN from secrets.NPM_TOKEN;
    5. runs gh release create with the same packed tgz and those notes.

    Permissions are contents: write and id-token: write.

  • pnpm-workspace.yaml: declares packages: ['.']. pnpm 9 rejected the file without it ("packages field missing or empty"). allowBuilds for esbuild is kept.

  • package.json:

    • repository, homepage and bugs now point at dsh-labs/dsh-code-highlight; provenance requires repository.url to match this repo;
    • adds publishConfig: { access: public, provenance: true };
    • pins packageManager: pnpm@11.25.0;
    • renames the script test:contract to contract.
  • tsdown.config.ts: moves from the deprecated external / noExternal to deps.neverBundle / deps.alwaysBundle. dist/client.js is byte-identical to before (sha256 b62ad502…).

  • .github/release-notes/v0.1.0.md: notes for the first release, ready for when it is tagged.

  • README: adds install instructions (dsh plugin --profile desktop add dsh-code-highlight), what the plugin does, the inherited limits, a compatibility table and the release process.

Testing

  • Locally, pnpm install --frozen-lockfile && pnpm run build succeeds on pnpm 9.15.9 (previously failed), 10 (defers to the pinned 11.25.0) and 11.25.0.
  • pnpm run typecheck passes; pnpm test passes 35/35; node scripts/contract.mjs passes 120/120 checks; scripts/check-reproducible.sh reports identical output; npm pack --dry-run lists 14 files at 19.2 kB.
  • The release workflow is not exercised by this PR. Nothing is tagged or published.

Notes

  • No tag and no publish. The first release (v0.1.0) waits for an explicit go-ahead.
  • Every release now requires .github/release-notes/vX.Y.Z.md; the release job fails early if the file is missing or lacks a heading.

- ci.yml: typecheck, build, test, contract (DSH 0.2.1-rc.5 / 0.2.2-rc.1), reproducible-build check and pack dry run on Node 22
- release.yml: on v* tags, verify tag == package.json version and release notes, rerun the checks, publish with provenance (next for prereleases, else latest) and create a GitHub Release with the tgz
- pnpm-workspace.yaml: declare packages so pnpm 9 accepts it; pin packageManager pnpm@11.25.0
- package.json: repository/homepage/bugs for dsh-labs/dsh-code-highlight, publishConfig
- tsdown: use deps.neverBundle/alwaysBundle (same output bytes)
- README: install, behaviour, limits, compatibility, release
@Rinai-R
Rinai-R merged commit 84aa91c into main Nov 11, 2026
1 check 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