ci: calculate build number based on the commit history#1383
ci: calculate build number based on the commit history#1383staceybeard merged 25 commits intomainfrom
Conversation
| with: | ||
| persist-credentials: false | ||
| # Fetch part of the commit history and its tags, in order to calculate the build number in `build-setup` | ||
| fetch-depth: 100 |
There was a problem hiding this comment.
This value is repeated a few times. Is there a way to define it once?
In addition, is 100 safe? If I understand this right, if there are more than 100 commits since the last release this won't work anymore.
There was a problem hiding this comment.
No problem, I've added it as a variable.
For the value, you're right, it wouldn't work in that case. It's a bit of a best guess (enough commits to work, not so many that it's overkill). I think we're unlikely to reach 100 commits between versions with the current team size. But I can easily change it if needed.
There was a problem hiding this comment.
Thanks. I think it's fine for now as it is. With regular releases this should hopefully never occur.
|
Nice work. Added a few questions, nothing that we absolutely need to change (given that it is probably time-intensive to test this). |
Co-authored-by: Matthias Schoettle <git@mattsch.com>
This reverts commit 93222a2.
Thanks, Matthias! |
| with: | ||
| persist-credentials: false | ||
| # Fetch part of the commit history and its tags, in order to calculate the build number in `build-setup` | ||
| fetch-depth: 100 |
There was a problem hiding this comment.
Thanks. I think it's fine for now as it is. With regular releases this should hopefully never occur.
|
Wait, one question remains: Does this mean we can avoid semantic release committing to |
Yes, that's right. I'm going to add semantic release as a manual workflow, so we'll only need to run it and have it commit when we want to bump the version number, so not for every commit. |
By submitting this merge request, I confirm the following:
Backendproject'sREADME.md)feat: minor app version will be incremented.fix,deps,perf: patch app version will be incremented.chore,ci, etc.: app version will not be incremented.for complete set of rules.
Changes
Added steps to the
build-setupaction to calculate a build number based on the number of commits between tags. For example, the first commit tagged v2.0.0 will be 2.0.0 (1). The next commit will be 2.0.0 (2), and so on, until the next tag.Dependencies