Release
Release the configured packages which have pending changes.
If there is a forge config set,
this creates a release with the same release notes that it added to the changelog (if any).
Otherwise, this tags the current commit as a release.
In either case, this step adds a new Git tag with the package’s tag format.
You should run PrepareRelease
before this step, though not necessarily in the same workflow.
PrepareRelease
will update the package versions without creating a release tag.
Release
will create releases for any packages whose current versions don’t match their latest release tag.
Tagging format
This step tags the current commit with the new version for each package.
If the config file is using the single [package]
syntax,
or there is no config file, this tag will be v{version} (for example v1.0.0 or v1.2.3-rc.4).
If the config file is using the [packages.{name}]
syntax,
each package gets its own tag in the format {name}/v{version}
(this is the syntax required for Go modules).
See examples below for more illustration.
Release notes
There are several different possible release notes formats:
- If run after a
PrepareRelease
step in the same workflow, the release notes will be the same as the changelog section created byPrepareRelease
even if there is no changelog file configured—with the exception that headers are one level higher (for example,####
becomes###
). - If run in a workflow with no
PrepareRelease
step before it (the new version was set another way), and there is a changelog file for the package, the release notes will be taken from the relevant changelog section. This section header must match exactly whatPrepareRelease
would have created. Headers will one level higher (for example,####
becomes###
). - If run in a workflow with no
PrepareRelease
step before it (the new version was set another way), and there is no changelog file for the package, the step will use automatic release notes generation.
Release assets
You can optionally include any number of assets to include in a release via package assets. If you do this, this step will:
- Create the release in draft mode
- Upload the assets one at a time
- Update the release to no longer be a draft (published)
If you have any follow-up workflows triggered by GitHub releases,
you can use on: release: created
to run as soon as the step creates the draft
(without assets) or on: release: published
to run only after the assets are uploaded.
Errors
This step will fail if:
- forge config exists but Knope can’t create a release on the forge. For example:
- There is no token set.
- The token doesn’t have permission to create releases.
- The release already exists on the forge (causing a conflict).
- There is no forge config set and Knope can’t tag the current commit as a release.
- Could not find the correct changelog section in the configured changelog file for loading release notes.
- One of the configured package assets doesn’t exist.
Examples
Create a GitHub release for one package
Here’s a simplified version of the release workflow used for Knope.
If PrepareRelease
set the new version to “1.2.3” then a GitHub release would be created called “1.2.3” with the tag “v1.2.3”.
Git-only release for one package
Here’s what Knope’s config might look like if it weren’t using GitHub releases:
If PrepareRelease
set the new version to “1.2.3”, then a Git tag would be created called “v1.2.3”.
Create GitHub releases for multiple packages
If PrepareRelease
set the new version of the knope
package to “1.2.3” and knope-utils
to “0.4.5”, then two GitHub release would be created:
- “knope 1.2.3” with tag “knope/v1.2.3”
- “knope-utils 0.4.5” with tag “knope-utils/v0.4.5”