Closed ryanmrichard closed 2 years ago
I have a workflow I spun up to test automated semantic versioning to master here: https://github.com/zachcran-research/semver-test. We could use that here if it is what you are looking for. Feel free to fork it, test it out with some commits and PRs, and refine it in any way you see fit.
The repo contains the workflow at .github/workflows/release.yaml
, a README.md
file that I have been updating to trigger CI, and VERSION.txt
and changelog.md
files that are updated automatically as part of the CI. The one catch is that the commit to master has to use the Conventional Commits formatting. It will also have to be updated to use the master
instead of main
branch, but that is an easy change. Looking at the releases posted on the project, I finally got it right around v1.3.4 or v1.3.5.
Edit: To generate a useful changelog on PR merges to master
, it seems that you need to use a merge commit instead of doing a squash and merge. The commits need to have Conventional Commits types on them to appear in the changelog. The latest release on my repo, v1.7.0, has a more full changelog than previous releases using this method.
@zachcran Thanks! This looks like it'll be useful. Admittedly I didn't really specify this in the issue, but I'm really hoping that we can roll the solution out to all of the CMakePP repos. While we could copy/paste your solution and modify it appropriately, I fear that's going to end up being a maintenance nightmare if we need to update/modifiy things as time goes on. That said, I think what you have here could form the basis for some central "single source of truth" once we have a process in place.
FWIW we have the same CI challenges in the NWChemEx project and are in the process of overhauling NWChemEx's CI. Point being I anticipate their solutions to be useful for us too and I would recommend people hold off on spending too much time on this issue (or the other CI issues) until we've figured out what we're doing in NWChemEx.
Tagging should now work. By default it will bump patch. We need to explicitly label the PR with the bump:major
or bump:minor
labels for the major and minor to be bumped. However, these don't make releases. I'll work on that tomorrow.
Releases are covered under #69, this issue was just for automating tagging. I vote we close it.
It'd be great if we could figure out a way to automatically semantically version commits to master.