This GitHub action creates a release based on your CHANGELOG.md
file.
You must use Keep a Changelog format or this will not work.
A release is created every time a new version header is added to your CHANGELOG.md
file. The content of the release is the entire text up to the next version header (the previously released version).
## [<version>] - yyyy-mm-dd
<content>
## [<previous version>] - yyyy-mm-dd
Add the following to a new .github/workflows/release_a_changelog.yml
file (or as part of your existing workflow):
name: Release a Changelog
on:
push:
branches:
- master
jobs:
release_a_changelog:
name: Release a Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release a Changelog
uses: rasmus-saks/release-a-changelog-action@v1.2.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
# Optional - path to your changelog file. Defaults to 'CHANGELOG.md'
path: 'path/to/my/CHANGELOG.md'
# Optional - format of the release title. Defaults to '{version}'
title-template: 'My Project {version}'
# Optional - format of the release tag. Defaults to '{version}'
tag-template: 'my-project-{version}'
⚠️ Make sure you have acheckout
action beforerelease-a-changelog
, otherwise it won't be able to read yourCHANGELOG.md
file
Use the title-template
and tag-template
inputs to define the format of the release title and tag for each separate project in your repository.
Use {version}
as a placeholder for the version number.
⚠️ Make sure thetag-template
is unique for each project in the repository, otherwise releases may clash with each other.
name: Release a Changelog
on:
push:
branches:
- master
jobs:
release_a_changelog:
name: Release a Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release a Changelog
uses: rasmus-saks/release-a-changelog-action@v1.2.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
path: 'my-sub-project/CHANGELOG.md'
title-template: 'My Sub Project {version}'
tag-template: 'my-sub-project-{version}'
- Add a new version to
CHANGELOG.md
according to Keep a Changelog - Push/merge to master
- ???
- Profit