GitHub action for updating changelog and bumping the project version using git commit messages formatted according to Conventional Commits and Semantic Versioning.
Uses tools newchanges and vp. Uses git to detect changed files. Only platforms Linux, macOS, Windows on the architecture X64 are supported.
Update the change log and write the new version ot the project source files:
- uses: prantlf/bump-version-action@v2
Work only in specific release branches, bump the version number in an extra file:
jobs:
build:
steps:
- uses: actions/checkout@v4
- uses: prantlf/setup-v-action@v2
- run: ...
- uses prantlf/bump-version-action@v2
with:
branches: master v1.x
bump-files: src/newchanges.v
Attention: This action can be used only to update an already published project. The first publishing has to happen manually:
- Changelog with the first version has to be added, for example, a file
CHANGELOG.md
:
# Changes
# 1.0.0 (2023-10-22)
Initial release
- Commit releasing the first version has to be correspondingly tagged, for example with
v1.0.0
.
Then this action can be added to a GitHub workflow.
The following parameters can be specified using the with
object:
Type: String
Default: 'main master'
Branches which this action should run for, which are used to publishing releases. Use whitespace for separating the branch names. If you want to use multiple lines in YAML, introduce them with ">-". If you want to allow all branches, set the value to "*".
Type: Boolean
Default: false
Set to true
to ignore package.json
and not handle the project as a Node.js package.
Type: Boolean
Default: false
Set to true
not to ignore v.mod
and not handle the project as a V package.
Type: Boolean
Default: false
Set to true
not to ignore Cargo.toml
and not handle the project as a Rust package.
Type: Boolean
Default: false
Set to true
not to ignore go.mod
and not handle the project as a Go package.
Type: String
Extra files in which to bump the version number, in addition to the package description file.
Type: Boolean
Default: true
Can be set to false
to prevent this action from running. It's helpful in the pipeline, which will not continue releasing, but only building and testing, and that will be decided in the middle of a job execution.
Type: Boolean
Default: false
Can be set to true
to only print what would be done without actually doing it.
Type: Boolean
Default: false
Can be set to true
to enable debug logging of the supporting tools. Debug logging will be enabled also if it's enabled on the runner.
The following parameters can be accessed by the github
context:
Type: String
Set to true
if the changelog was updated and the new version set.
Type: String
The new version written to the changelog and to the project source files.
Type: String
Files modified by this action, separated by spaces.
Copyright (C) 2023-2024 Ferdinand Prantl
Licensed under the MIT License.