Skip to content

ci: auto tag - #5

Merged
th3r-dev merged 5 commits into
devfrom
feature/auto-tag
Aug 3, 2026
Merged

th3r-dev merged 5 commits into
devfrom
feature/auto-tag

Conversation

@th3r-dev

@th3r-dev th3r-dev commented Aug 3, 2026

Copy link
Copy Markdown
Owner

What change

  • Add auto tag ci

@th3r-dev th3r-dev self-assigned this Aug 3, 2026
@th3r-dev th3r-dev added the enhancement New feature or request label Aug 3, 2026
@th3r-dev
th3r-dev changed the base branch from main to dev August 3, 2026 16:52
theeraphat.ch added 4 commits August 3, 2026 23:52
No workflow ran on branch pushes or pull requests: cavimg-package.yaml
only triggers on v* tags and workflow_dispatch, so typecheck, tests and
the Go MCP suite were never exercised before a publish.

Add ci.yaml (push/PR on main, plus workflow_call) running cavimg
typecheck/test/build and cavimg-mcp vet/test.

Add dev-check.yaml (push/PR on dev) which reuses ci.yaml and then runs
`npm publish --dry-run` so dev validates the packed tarball and manifest
without contacting the registry or publishing.

Both pin pnpm/action-setup by commit SHA, declare `permissions:
contents: read`, and keep `${{ }}` out of run blocks, matching the
hardening in a4ac388.
Cutting a release needed a hand-pushed tag, so a merged dev -> main PR
left main untagged and cavimg-package.yaml with nothing to trigger it.

Add release-tag.yaml, triggered on a closed pull request against main and
gated on `merged == true` with head.ref == 'dev'. It reuses ci.yaml to
typecheck, test and build the merge commit, and only once that passes
reads packages/cavimg/package.json and pushes an annotated v<version>
tag at the merge commit. If the tag already exists the run is a no-op
and the job summary says so, so doc-only merges cut no release and the
version bump stays the release trigger.

Give ci.yaml an optional workflow_call `ref` input so the reusable call
checks out the merge commit rather than the closed PR's merge ref.

Publishing stays manual: tags pushed with GITHUB_TOKEN do not trigger
other workflows, so cavimg-package.yaml does not fire. The job summary
links the operator to the dispatch button.
A fork branch also named dev would otherwise satisfy the head.ref guard.
Compare head.repo.full_name against github.repository so only the
upstream dev branch can cut a tag.
`npm publish --dry-run` still queries the registry to check whether the
version exists and exits 1 when it does. Once cavimg@1.0.2 went live the
dev-check pack job failed on every run with "You cannot publish over the
previously published versions: 1.0.2", because dev carries the version
that was just released until someone bumps it.

Use `npm pack --dry-run`, which is purely local, and follow it with a
non-fatal `npm view` probe that reports whether the current version is
already on npmjs — turning the old hard failure into the useful signal
"bump before merging or no release is cut".

Correct the dry_run wording in cavimg-package.yaml, which claimed the
flag does not contact the registry. It does, and its dry_run path fails
the same way on an already-published version.
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@th3r-dev
th3r-dev merged commit d245c1b into dev Aug 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant