Maxime Mangel

EasyBuild.ShipIt: versions and changelogs from your commits

On this page
  1. Try it
  2. How a release works
  3. You write Conventional Commits
  4. ShipIt finds the projects
  5. ShipIt picks the version
  6. ShipIt writes the changelog
  7. ShipIt opens the pull request
  8. You merge, your workflow publishes
  9. Configuration lives in the changelog
  10. Set up GitHub
  11. Limits

EasyBuild.ShipIt turns your commit history into versions, changelogs and release pull requests.

It is a .NET tool. For each project, it computes the next version from your commits, writes the changelog entry and opens a pull request for the release. When you merge that pull request, your workflow publishes the packages.

Try it

Terminal
dotnet tool install EasyBuild.ShipIt
dotnet shipit init changelog
dotnet shipit --dry-run

init changelog creates a minimal CHANGELOG.md. --dry-run shows what ShipIt would do without changing a file or opening a pull request.

How a release works

  1. You write Conventional Commits

    ShipIt reads commits that follow Conventional Commits, in the form <type>[optional scope][optional !]: <description>.

    An invalid commit stops the run, unless you pass --skip-invalid-commit.

  2. ShipIt finds the projects

    Each CHANGELOG.md in the repository is a project, except under node_modules/, fable_modules/ or a path ignored by Git.

    For each project, ShipIt reads the commits since the last release that touch the changelog's folder. The changelog stores that last commit as last_commit_released.

  3. ShipIt picks the version

    • A breaking change bumps the major version.
    • feat and perf bump the minor version.
    • fix bumps the patch version.

    When the commits mix types, the highest bump wins. With no commit to release, ShipIt leaves the version as it is.

  4. ShipIt writes the changelog

    The new entry groups the commits under breaking changes, features, bug fixes and performance improvements, and links to the diff. last_commit_released moves to the last commit included in the release.

  5. ShipIt opens the pull request

    ShipIt pushes the changes to a release branch and opens a pull request, or updates the one already open.

  6. You merge, your workflow publishes

    ShipIt does not publish anything. Your workflow runs a publish job when the head commit message starts with chore: release .

By default ShipIt opens a pull request. --mode local only writes the changelog, and --mode push commits the release to the current branch and pushes it.

For an example of the output, see ShipIt's changelog, or the Glutinum 0.13.0 entry, which adds code samples to the generated lines.

Configuration lives in the changelog

There is no separate configuration file. Settings go in the YAML front matter of each CHANGELOG.md:

CHANGELOG.md
---
last_commit_released: abcd1234
include:
  - ../Shared/
---

# Changelog

In a monorepo, each project has its own CHANGELOG.md, and only commits in the changelog's folder count.

Add shared folders with include. With depends_on, a project is released again when one of its dependencies is released.

All projects go into one pull request. I release the seven packages of Fable.Ripple this way.

With pre_release: beta, or --pre-release, a feat on top of 1.2.10 gives 1.3.0-beta.1, and the next release gives 1.3.0-beta.2. Remove the setting and the next release gives 1.3.0.

The README lists the other settings, including updaters, which write the new version into other files.

Set up GitHub

Terminal
dotnet shipit init workflows
dotnet shipit init github

init workflows adds three workflows to .github/workflows/:

  • conventional-pr-title.yml checks that pull request titles follow Conventional Commits.
  • test.yml runs your tests.
  • easybuild-shipit.yml runs ShipIt when the tests pass on main.

When the commit is a chore: release commit, easybuild-shipit.yml also publishes to NuGet with Trusted Publishing, so the repository stores no API key. Change the publish step if you release something else. The workflow runs dotnet tool restore, so install ShipIt in a tool manifest.

init github uses the GitHub CLI to switch on squash merges with the pull request title as the commit message, and to allow GitHub Actions to create pull requests. It only sends the settings that differ, so you can run it again.

Limits

  • The pull request and push modes work with GitHub only, and need the gh CLI. The code is written so other providers can be added: open an issue if you need one.
  • The version rules and the changelog sections are fixed.

In CI, the checkout must have enough history to reach last_commit_released. When it does not, the run fails with a Git error like this one:

fatal: Invalid revision range 33474b29d213862ab9876a3e414dfedfab99e2f9..HEAD

Increase fetch-depth in actions/checkout, or set it to 0 to fetch the full history.

More on EasyBuild

Automating your releases?

I can set up versioning, changelogs and publishing for your .NET or Fable repository.

Write to me