Making a nice release commit might indicate a few boring steps - adding a changelog, tagging, update project version.
So why not .. A util script to make an atomic release commit including tag, changelog and updated Project file. Supports mvn, npm or gradle. Relies on Conventional Commits-standard. Sure!
Briefly, this script:
- calculates and tags with next semver tag
- generates a changelog in the Keep-A-Changelog-format, based on your Conventional Commits Git history.
- updates the project file version with the version tag, if applicable.
- commits the changelog and tag in a release commit
- pushes the commit
All steps optional!
Quite early version, but useable.
- Installation and Requirements
- Usage
- Known Issues
- Support
- Contributing
- Development
- License
- Maintainers
- Credits and References
- Your project is (mostly) following the Conventional Commits Standard.
- Your Git Settings is configured to sign and tag with SSH.
- If you are not running the Snap, but go for the script directly, you will need a few dependencies.
- Clone this repo
git@github.com:janderssonse/changelog-tag.git
- Install needed dependencies.
A simple suggestion is to install the nice runtime version manager asdf-vm.
Following are a few commands that adds the plugins and then installs them for you.
Note, it will set them globally in this example, but you can later switch versions with asdf, if needed for other projects, see the asdf-vm documentation.
# add asdf plugins from the asdf-vm .tool-versions file
$ cut -d' ' -f1 .tool-versions | xargs -i asdf plugin add {}
# install all listed .tool-versions plugins versions
$ asdf install
# pin the asdf versions (if you need)
$ asdf global git-chglog 0.15.4
$ asdf global java adoptopenjdk-jre-17.0.8+7
$ asdf global maven 3.8.8
$ asdf global nodejs 20.4.0
- Finally, from the root dir of the project you are about to update a changelog to, do
/path/to/changelog-tagrepo/you/just/cloned/src/changelog_tag.sh --help
Currently, the Snap is not published to the official store. So, have a look under Actions/Artifacts and get the latest build.
As the Snap is not published on the official Snap store and still has a problem with connecting to host SSH-AGENT, you have to add --devmode flag.
snap install --devmode ./changelog-tag_v0.0.1_amd64.snap
You also have to give the snap read-access to your Git configuration.
snap connect changelog-tag:gitconfig
snap connect changelog-tag:etc-gitconfig
Now, you can do an --help
changelog-tag --help
There is a helpscript which will mount ssh agent and more for you, expecting Podman
/path/to/repo/you/just/cloned/scripts/run_changelog_release_container.sh '--help'
And you should get an overview of options. NOTE: as you run in an container, arguments will have to be given in one string surrounded by '' as in the example above.
A picture says more than a thousand words.
changelog_tag with --help option changelog_tag run changelog_tag generated changelog exampleRoadmap:
- More choices regarding configuration
- Fully support prerelease and build options
- Rewrite in golang to ease maintenance etc
- Hope cogitto fixes the final bugs so this project can be deperacated
- See Issues for other ideas
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.
Please see CONTRIBUTING.
The project uses the Bash test framework Bats.
You can find a helper script for installing bats-core with dependencies in the (/development/):
./development/install_bats.sh
Note: The bats files are installed under the <projectdir>/development/lib
, not globally on on your system
To run the tests:
./development/lib/bats/bin/bats src/test
There is a script that checks code quality, commit history and license compliance. Please run that.
It is dependent on podman
, and uses megalinter
, reuse-tool
, conform
, kcov
to check for various aspects of quality and coverage.
./development/code_quality.sh
Note: megalinter checks a lot of things, shellcheck etc, see the development/mega-linter.yml
for enabled linters,
Licensed under the GNU General Public License v3.0 or later.
Most other files are under CC0, but check the SPDX-headers if curious.
- Git Changelog Generator
- The Bats project - for making us create robust Bash-scripts.
- Danneleaf - for the patch in an earlier incarnation of this util.
- Digg for some of the CC0 texts from their Open Source Project Template.