Releasing

A release moves every unreleased entry into one release file. With semantic versioning, it also writes the new version to your version files. You make the release on a branch and merge it as its own pull request.

Run shipnotes release

Start from an up-to-date default branch. Create a branch and preview the release:

$ git switch -c release
$ shipnotes release --dry-run
would release 0.2.0 (0.1.0 -> 0.2.0) with export-widgets-to-csv, price-rounding
  would write changelog/releases/0.2.0.yml
  would write lib/acme_widgets/version.rb
  would write CHANGELOG.md
  would delete changelog/unreleased/export-widgets-to-csv.yml
  would delete changelog/unreleased/price-rounding.yml

Then run it without --dry-run:

$ shipnotes release
released 0.2.0 (0.1.0 -> 0.2.0) with export-widgets-to-csv, price-rounding
  wrote changelog/releases/0.2.0.yml
  wrote lib/acme_widgets/version.rb
  wrote CHANGELOG.md
  deleted changelog/unreleased/export-widgets-to-csv.yml
  deleted changelog/unreleased/price-rounding.yml

With no unreleased entries, release prints no unreleased entries; nothing to release and exits with status 0.

Options

Option Effect
--dry-run Prints what would change. Writes nothing.
--version VERSION Uses this version instead of the computed one. Pre-releases such as 2.0.0-rc.1 are allowed. See Versioning.
--date DATE The release date, as YYYY-MM-DD. The default is today.
--root DIR The project root. See Project root.

What release writes and deletes

  1. It writes changelog/releases/ID.yml with the release id, date, version and every entry.
  2. It writes the new version to each version file, if the version changed.
  3. It deletes each unreleased entry file.
  4. It renders render.output, usually CHANGELOG.md, unless output is null.

The release file for the example above is:

---
release: 0.2.0
date: '2026-12-01'
version: 0.2.0
entries:
- id: export-widgets-to-csv
  title: Export widgets to CSV
  kind: added
- id: price-rounding
  title: Fix rounding in widget prices
  kind: fixed
  body: Prices now round half up.

When release refuses to run

release stops with exit status 1 and writes nothing in these cases:

  • shipnotes lint reports a problem: fix the changelog first: and the problems.
  • A version file does not exist: version files not found: PATH.
  • A version file disagrees with the release history: lib/acme_widgets/version.rb is "0.3.0", but the release history is at 0.2.0.
  • The chosen version is not valid. See Versioning.
  • The release file already exists.
  • --date is not YYYY-MM-DD.
  • --date is before the date of the last release.
  • --version is given and scheme is none.

Release ids

versioning.release_id sets the name of the release file.

release_id Example file Use it for
version changelog/releases/1.4.0.yml Gems and libraries. Each release needs a new version, so a release takes at least a patch bump.
date changelog/releases/2026.12.01.1.yml Apps that deploy often. The last number counts the releases on that date, starting at 1.

A date id can still carry a version when scheme is semver. CHANGELOG.md then shows both: ## [2026.12.01.1] - 2026-12-01 (1.0.0). With date ids, a release whose entries do not bump keeps the current version.

The release pull request

Commit the result and open it as its own pull request:

git add -A
git commit -m "Release 0.2.0"

The CI check verifies the pull request against what release would write. It prints release PR verified. Do not add other changes to this pull request. The check rejects a release pull request that changes any file other than the release file, its deleted entries, the version files and the changelog. Pull request check lists every rule.

Release notes for GitHub releases

shipnotes notes prints one release as Markdown. It takes a release id or a version. A leading v is allowed. Without an argument, it prints the newest release.

$ shipnotes notes 0.2.0
## Added

- Export widgets to CSV

## Fixed

- Fix rounding in widget prices

  Prices now round half up.

Use it with the GitHub CLI:

shipnotes notes 0.2.0 > notes.md
gh release create v0.2.0 --title v0.2.0 --notes-file notes.md

The notes contain only public entries. An unknown release stops with shipnotes: no release ID and exit status 1.

Render the changelog

release renders CHANGELOG.md for you. Run render after you change the template or the render settings:

shipnotes render                       # write render.output
shipnotes render --output -            # print to standard output
shipnotes render --output docs/changes.md
shipnotes render --unreleased          # add an Unreleased section

When render.output is null and you give no --output, render prints the changelog. Only public entries appear, and a release without a public entry is left out. To change the layout, see Custom templates.

Current and next version

current prints the current version. next prints the version that the unreleased entries lead to. Without unreleased entries, next prints the current version.

$ shipnotes current
0.1.0
$ shipnotes next
0.2.0

Both commands stop with this project does not version releases when scheme is none. Versioning explains where the current version comes from.

Publish a gem when the version changes

This workflow publishes acme_widgets after a release pull request merges. It runs on every push to main. It does nothing when the tag for the current version exists.

name: Publish

on:
  push:
    branches: [main]

jobs:
  publish:
    runs-on: ubuntu-latest
    environment: release
    permissions: { contents: write, id-token: write }
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: ruby/setup-ruby@v1
        with: { bundler-cache: true }
      - id: version
        run: |
          VERSION="$(bundle exec shipnotes current)"
          echo "version=$VERSION" >> "$GITHUB_OUTPUT"
          if git rev-parse "v$VERSION" >/dev/null 2>&1; then echo "tagged=true" >> "$GITHUB_OUTPUT"; fi
      - if: steps.version.outputs.tagged != 'true'
        uses: rubygems/configure-rubygems-credentials@c6ca7f4bac0e29c9bde8eeae0a0a986b27efa05f # v2.2.0
        with: { owner: ${{ vars.RUBYGEMS_OWNER_ID }} }
      - if: steps.version.outputs.tagged != 'true'
        env:
          GH_TOKEN: ${{ github.token }}
          VERSION: ${{ steps.version.outputs.version }}
        run: |
          gem build acme_widgets.gemspec
          gem push acme_widgets-*.gem
          bundle exec shipnotes notes "$VERSION" > "$RUNNER_TEMP/notes.md"
          gh release create "v$VERSION" --target "$GITHUB_SHA" --title "v$VERSION" --notes-file "$RUNNER_TEMP/notes.md"

The job uses RubyGems trusted publishing, so no API key is stored in GitHub. Add a trusted publisher for the repository, publish.yml and the release environment on rubygems.org first. For a gem that is not on RubyGems yet, RubyGems also needs the ID of the account that will own it: copy it from your Pending Trusted Publishers page into the repository variable RUBYGEMS_OWNER_ID. gh release create also creates the tag. RubyGems writes a pre-release such as 1.1.0-rc.1 as 1.1.0.pre.rc.1, so the workflow pushes the built file by glob.