Skip to content

Add CI and publishing workflows to v2 - #112

Open
dcruzb wants to merge 2 commits into
v2from
ci/add-workflows
Open

Add CI and publishing workflows to v2#112
dcruzb wants to merge 2 commits into
v2from
ci/add-workflows

Conversation

@dcruzb

@dcruzb dcruzb commented Sep 11, 2026

Copy link
Copy Markdown
Member

v2 had no .github directory at all: nothing type-checked it, nothing ran its tests, and it had no path to npm. This is the only thing standing between v2 and being publishable as v2-latest.

The three workflows

check.yml — mirrors v1's, with two differences. It points tsc at tsconfig.app.json, because tsconfig.json is a solution file with "files": [] and checking it would check nothing. And it runs vitest, which v1 has no equivalent for.

deploy.yml — publishes on a version/v* tag through OIDC trusted publishing with --provenance. Two adaptations matter:

  • LATEST_MAJOR stays at 1, so a 2.x tag publishes under the v2-latest dist-tag. Nobody running npm i @cincoders/cinnamon is upgraded into the rewrite until you change that value on both branches.
  • The ancestry check compares the tagged commit against v2, not main. The branches share no history, so the v1 version of this check would reject every v2 tag.

build-storybook.yml — builds without deploying. GitHub Pages serves one site per repository and the workflow on main already publishes v1's Storybook there; if this branch deployed too, whichever ran last would replace the other. The comment in the file says what to change when v2 becomes the mainline.

One fix that is not CI

package.json had repository.url as github.com/cincoders/cinnamon, lowercase. Publishing with --provenance makes npm compare that against the repository recorded in the signed attestation, case sensitively, and GitHub reports CinCoders. The 1.5.0 release failed on exactly this with a 422 after the tarball had already been built and signed. v2 would have hit the same wall on its first publish.

Already configured on the repository

The npm trusted publisher is registered for CinCoders / cinnamon / deploy.yml / environment npm-publish. Since it matches on the workflow filename and not the branch, this file reuses that registration — no second setup needed. The npm-publish environment requires a reviewer before any publish runs.

Worth a look, not changed here

package.json defines "prepublishonly". npm's lifecycle hook is prepublishOnly, camel-cased, so this script never runs automatically. It does not affect this workflow, which builds explicitly before publishing, but it would silently do nothing for anyone publishing by hand. Left alone since it is your build config.

v2 had no .github directory, so nothing type-checked it, nothing tested
it, and it had no path to npm. These mirror the v1 workflows, adapted:

- check.yml points tsc at tsconfig.app.json, because tsconfig.json is a
  solution file with "files": [] and would check nothing, and it runs
  vitest, which v1 has no equivalent for.
- deploy.yml keeps LATEST_MAJOR at 1, so a 2.x tag publishes under the
  v2-latest dist-tag and no existing consumer is upgraded into the
  rewrite by installing @cincoders/cinnamon. It also checks the tagged
  commit against v2 rather than main, since the branches share no
  history.
- build-storybook.yml builds without deploying. GitHub Pages serves one
  site per repository and main already publishes v1's Storybook there.

package.json carried the repository URL as github.com/cincoders/cinnamon.
Publishing with --provenance compares that against the repository in the
signed attestation, case sensitively, and GitHub reports CinCoders. The
1.5.0 release failed on exactly this and v2 would have hit it too.
The Page story declared footerCopyrightText with a type, a control and a
default, and passed it to Footer as copyrightText. FooterProps has no
such property and nothing else in the tree mentions copyright, so the
whole argument was inert: a leftover from the v1 Footer API.

Nothing caught it because v2 had no type check. Vite compiles without
checking types, so the story built and rendered while the prop was
silently discarded.
@sonarqubecloud

Copy link
Copy Markdown

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