Skip to content

ci: release automatically when the version changes on main - #34

Merged
Francois-Francois merged 1 commit into
mainfrom
ci/automated-release
Oct 23, 2026
Merged

Francois-Francois merged 1 commit into
mainfrom
ci/automated-release

Conversation

@Francois-Francois

Copy link
Copy Markdown
Contributor

Releasing no longer needs a manual tag: a pull request that changes the version of visual-editor/package.json is released when it is merged.

On a push to main that changes the version, publish.yml (same file name, still the npm trusted publisher):

  1. stops if the X.Y.Z tag exists or if the version is already on npm, and does nothing if the version did not change,
  2. runs test.yml (now also workflow_call): type check, build, vitest, Cypress,
  3. creates the tag on the merged commit (API call with GITHUB_TOKEN, so it does not start another run),
  4. publishes with npm publish --provenance in a job with the OIDC token and no dependency cache,
  5. creates the GitHub release with the changelog section of the version, or the commits since the previous tag when the section is missing.

Fallbacks kept: a manual run on main releases the current version if it has no tag yet; a tag pushed by hand, or a manual run on a tag, publishes that tag (retry after a failure).

pnpm release:prepare <patch|minor|major|X.Y.Z> bumps the version and adds the changelog section, prefilled with the commits since the last tag. CONTRIBUTING.md and RELEASING.md describe the process.

Checks: actionlint, release:prepare and release:notes run locally (existing section, missing section, invalid arguments). The workflow itself only runs after the merge.

The Publish workflow now runs on a push to main that changes the version
of visual-editor/package.json: it refuses an existing tag or a version
already on npm, runs the test workflow, creates the X.Y.Z tag, publishes
with trusted publishing and provenance, then creates the GitHub release
from the changelog section (the commits since the previous tag when it
is missing). The file keeps its name, declared as the npm trusted
publisher. A manual run on main releases the current version, a tag
pushed by hand or a manual run on a tag stays the fallback.

pnpm release:prepare <patch|minor|major|X.Y.Z> bumps the version and adds
the changelog section, prefilled with the commits since the last tag.
@Francois-Francois
Francois-Francois merged commit becd5ce into main Oct 23, 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