Skip to main content

Release how-to

This page explains how to release a new version of @maxgraph/core.

The release process is partially automated with GitHub Actions, but initialization steps (version updates, tagging) are manual. Further automation is tracked in #664.

Prerequisites​

  • Releases are done from the default branch
  • Ensure that all GitHub Actions runs are successful
  • Make sure that the documentation is up-to-date

Preparation​

The preparation is done with the prepare-release Claude Code skill (.claude/skills/prepare-release). Invoke it with /prepare-release. It follows the steps below in this order: it starts with the version, then pauses so that the milestone is managed once the version is known, and resumes with the release notes.

Version​

Between two releases, the main branch carries a development version: the next patch version of the latest release with the -dev suffix, for instance 0.25.3-dev after 0.25.2. It tells a build of main apart from the release it follows. The development version may never be released: when the next release is a minor one, 0.25.3-dev is followed by 0.26.0. See ADR 0004 for the reasons.

The latest release is therefore known twice: from the development version, node scripts/versions.mjs previous-release prints 0.25.2 for 0.25.3-dev, and from the latest tag. Both must agree. If they do not, the development version was not set after the previous release, or was changed by hand: understand why before going further.

Decide on the new version depending on the type of changes:

  • Follow semver
  • Check the new commits since the latest release to determine the types of changes included in the new version. This can be done by:
    • running locally git log --oneline <latest-release-tag>..HEAD or by automatically retrieving the latest tag:
      LATEST_TAG=$(git describe --tags --abbrev=0)
      git log --oneline ${LATEST_TAG}..HEAD
    • going to the latest GitHub release page and checking the commits since this release (a link is available just above the release title).
  • Until we release the first major version, bump the minor version if the release contains new features or breaking changes.

The skill applies these rules: it computes the version from the conventional commits since the latest release, proposes it, and waits for your confirmation.

Milestone management​

Check the milestone associated with the new release. Note: We always put issues related to a version into a Milestone whose name matches the version.

  • Make sure that the name of the milestone used for the new release version matches the name of the version being released. Rename it if necessary.
  • Verify that all issues related to the upcoming release are attached to the milestone. In particular, check the issues that were closed as completed without a milestone, ignoring the issues labelled question.
  • Check the closed issues of the milestones of the later versions, if any (see the warning below).
  • Clean up this open milestone if some issues are still open: move them to the milestone of the next minor version, or discard the milestone from them. If the milestone of the next minor version does not exist, create it.
  • Close the milestone.
warning

An issue closed in the milestone of a later version, such as 0.26.0 when releasing 0.25.0, was most likely done for the version being released, and its milestone was not updated. Decide for each one whether to move it to the milestone of the release, keep it where it is, or remove its milestone.

Once the version is confirmed, the skill pauses. It creates the milestone of the next minor version if it does not exist, and reports what it finds without changing anything else: whether a milestone matches the version, the issues still open in it, the issues closed since the previous release that have no milestone, and the closed issues found in the milestone of a later version, for which it asks you what to do. Do the other changes yourself, then tell the skill to resume.

Release notes preparation​

Prepare the release notes before running the tag and npm publish operations, so you can publish them quickly once the release resources (npm package, examples and website assets) are available.

Release notes are documented in two places: the CHANGELOG.md file in the repository and the GitHub release page (the latter is initialized from a template by a GitHub Actions workflow). The detailed release notes are written first: the one-line summary of the CHANGELOG.md entry, which broadly describes the changes in the release, is derived from them, and is reused on the GitHub release page.

The skill analyzes the commits since the previous release and their linked pull requests to:

  • draft the breaking changes, split between those concerning every user and those concerning TypeScript users only, the deprecation notices and the feature highlights,
  • select the significant documentation additions and changes to mention,
  • collect the bundle size of the examples of both repositories (maxGraph and maxgraph-integration-examples) from the CI logs, and compare them with the previous version recorded in the bundle size history of the docs/release-history directory,
  • write the release notes body and the one-line summary,
  • write the CHANGELOG.md entry of the new version, adding the breaking changes and behavior changes missing from the ## Unreleased section (the CHANGELOG.md lists breaking changes and the behavior changes users may have to adapt to, not the other features and fixes, and the deprecation notices are in the release notes),
  • append the sizes of the new version to the bundle size history,
  • run the tests of the core package with coverage, and append the number of tests and the coverage of the new version to the test history (docs/release-history/core-tests.csv),
  • tighten the size budgets of the examples whose bundle shrank, so that they match the sizes of the new version. The CI fails when a bundle exceeds its budget, but does not detect a budget left too loose after a bundle got smaller. The webpack examples are built locally for this, since their entrypoint size is not precise enough in the CI logs.

The CHANGELOG.md, bundle size history, test history and size budget changes are left uncommitted: they are part of the release commit (see Apply changes in the source code). So the skill writes them on an up-to-date main branch, and asks you to switch to it if needed.

The skill is used in two phases:

  • Now, to prepare the content: run it during this preparation step. At this stage the GitHub draft release does not exist yet, so the skill writes the release notes to a local file.
  • Later, to finalize the GitHub release: once the tag is pushed and the npm package is published, the draft GitHub release exists, so the skill can update it in place while preserving the auto-generated Resources section (see Finalize the GitHub release).

Apply changes in the source code​

  • Prerequisites:
    • Releases are done from the default branch, so all changes are done in the main branch.
    • These changes are going to be done locally and then pushed to the repository.
    • Make sure that the code is up to date with the main branch. Run git pull to get the latest changes. If it brings commits merged after the release preparation, prepare the release again, since the release notes, the bundle sizes and the test history describe the code the skill measured: first discard the uncommitted changes of the previous run, restoring only the tracked files the skill listed in its final report (git restore <files>; RELEASE_NOTES_DRAFT.md is ignored by git and rewritten by the next run), then run the prepare-release skill again. Both are needed: the skill requires a clean working tree, and its test history step refuses a row that already exists.
  • Update the version in various files by running, from the repository root: node scripts/update-versions.mjs <version> (replace <version> with the new version). It replaces the development version, 0.25.3-dev for instance, by the version being released.
  • Check the CHANGELOG.md entry of the new version written by the prepare-release skill during Release notes preparation. If you write it yourself, follow the format of the previous entries:
    • Add the version heading right after the note of the ## Unreleased section, followed by the release date.
    • Add a link to the future GitHub release, as shown below:
For more details, see the [0.1.0 Changelog](https://github.com/maxGraph/maxGraph/releases/tag/v0.1.0) on the GitHub release page.
  • Add the one-line summary of the release notes.

  • Include all breaking changes, at the summary level, or state **Breaking Changes**: none. when there are none.

  • Check the new rows of the bundle size history and of the test history (docs/release-history), also written by the skill.

  • Check the size budgets of the examples (webpack.config.js and vite.config.js of the packages/*-example* directories), tightened by the skill.

  • Make a single commit that includes the changes described above

    • Use the following template for the commit message: chore(release): prepare version 0.2.0
  • Create a git-annotated tag on this commit, prefixing the version with a v. For example, if the version is 0.2.0, run:

git fetch --tags
git tag -a v0.2.0 -m "chore: release version 0.2.0"
  • Set the development version that follows the release, and commit it:
    • Run, from the repository root: node scripts/update-versions.mjs --next-development. It reads the released version and sets the next patch version with the -dev suffix, 0.2.1-dev for 0.2.0.
    • Make a second commit with these changes, using the following template for the commit message: chore(release): start the development of 0.2.1-dev
    • The tag stays on the release commit, the one before. Check it with git log --oneline --decorate -2. The npm publication workflow fails if the version of the tagged commit differs from the tag.
  • Push the two commits and the tag, during the same bypass of the rulesets
    • The default branch and the tags are protected by GitHub rulesets that prevent direct pushing.
    • Update the rulesets and add a bypass permission for your account.
    • Push the default branch, which carries the two commits: git push origin main
    • Push the tag, for example git push origin v0.2.0
    • Update the rulesets to remove the bypass permissions.

Publish the npm package​

The package is published automatically once the Git tag is pushed thanks to a GitHub workflow.

If its execution fails, and you want to publish the package manually:

  • Checkout the tag that has just been created
  • From packages/core:
    • run npm publish

Finalize the GitHub release​

The release workflow has initiated a new draft GitHub release, which needs to be updated and published. For more details about GitHub release, follow the GitHub help

This new draft release includes a template to guide the writing of the content, so update the content accordingly to the changes included in the new version.

The list of the major changes has been automatically generated. Review and adjust it if necessary:

  • It is based on the labels of the merged Pull Requests included in this release and the GitHub release configuration.
  • If the list is incorrect (for example, an item is not in the correct category), update the label(s) or the associated Pull Request and regenerate the list.

The GitHub workflow automatically attaches the examples and website zip files to the release as assets, so check that they are present.

The draft release already exists at this point, so it is time to update its content with what you prepared during the Release notes preparation phase. Replace everything above the Resources section (summary, breaking changes, highlights, the bundle size tables and the documentation changes), and keep Resources and the automatically generated list below it. Also, keep the release date already present on the first line of the draft, which the workflow set to the actual release date.

If you used the prepare-release skill, run /prepare-release to apply this update automatically.

Before you publish the release, make sure that a discussion will be created in the Announces category when the release is published, by ticking the corresponding checkbox.

Publish the release.

Review the newly created discussion in the Announces category: