Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate changelog with each release #82

Merged
merged 17 commits into from May 22, 2024

Conversation

volkertb
Copy link
Collaborator

@volkertb volkertb commented Jan 27, 2024

Fixes #73

@volkertb volkertb force-pushed the generate-changelog-with-each-release branch from 1b522f3 to bfbe717 Compare January 27, 2024 13:12
…nerator` instead of relying on GitHub's release notes generation functionality, which apparently doesn't render the release notes in a Markdown file
…t also works when build is triggered by a non-tag commit, for instance while testing the workflow in a branch, as is the case while writing this commit
…rrent directory, while the code was actually checked out under the subdirectory `./src`
@volkertb volkertb force-pushed the generate-changelog-with-each-release branch 4 times, most recently from b86bf30 to fb556db Compare January 27, 2024 14:24
@volkertb volkertb force-pushed the generate-changelog-with-each-release branch from fb556db to d71dbae Compare January 27, 2024 14:25
…eded to generate changelog from commits between latest and previous tags
…ince the actual cause was found: `actions/checkout` checks out the repo with a depth of 1 (only the most recent commit) by default, so history including previous tags isn't available by default (we fixed that configuration in the previous commit)
…its in changelog, even those that don't have a "type" defined according the Conventional Commits format (feat, feature, fix, bugfix, perf, refactor, test, tests, chore`)
@volkertb volkertb force-pushed the generate-changelog-with-each-release branch from ad67975 to b1838c4 Compare January 27, 2024 15:14
@volkertb volkertb force-pushed the generate-changelog-with-each-release branch from b1838c4 to ca571ba Compare January 27, 2024 15:17
@volkertb volkertb force-pushed the generate-changelog-with-each-release branch 2 times, most recently from f115293 to 6e065a1 Compare January 27, 2024 15:48
… by a SemVer-compliant version number, for instance `v1.0.0`) is pushed to the Git repo
@volkertb volkertb marked this pull request as ready for review January 27, 2024 15:57
@volkertb volkertb requested a review from crazii January 27, 2024 15:57
@volkertb
Copy link
Collaborator Author

volkertb commented Jan 27, 2024

Here is the most recent successful release based on this change in my branch, to give you an idea what the release notes will look like.

@crazii Before you merge this, there are two things you have to be aware of, once this is merged:

  • If you want the various commits to be properly "categorized" in the changelog, it's advisable to prefix each commit message according to the "Conventional Commits" format, for example feat: for a new feature, fix: for a bugfix, etc. Any commits that don't follow this conventions will be listed under Other Changes in the changelog.
  • With this change, there will be no automatic releases on each push or merge to main anymore. Instead, a release will be triggered when you create a tag and push it, and the tag must be a proper SemVer-compliant version, prefixed with a v.

For instance, to make the first release in this new format:

git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0

Before tagging and pushing a new release, you can enter git tag to get a list of existing tags, so you'll know which next version number to use. Whether you only update the patch number (the third number), the minor number (the second number) of the major number (the first number, the left-most one before the first dot) is best up to you to decide, and pretty much depends on the scope and nature of the changes in the release that you are pushing. If it's just minor bugfixes, for instance, you can just increase the patch number.

Oh, and the release notes (changelog going back to the previous release, plus the user instructions that we were always showing in the release up until now) is now being included in both the ZIP file and in the USB image. (In DOS, you can just do type RELEASE_NOTES.md, since Markdown files are perfectly readable as raw text files. 🙂

I know this can all still be improved further, but let's do so incrementally in separate PRs.

Please let me know if you have any questions! If you agree to these conventions and this workflow, feel free to merge this. Thanks! 🙂

@volkertb volkertb self-assigned this Jan 27, 2024
@crazii
Copy link
Owner

crazii commented Jan 30, 2024

I think I can give the conventional commits a try, but I have a few question,

What about PR from others? It's might be hard to force a restriction on everyone.
There's also some WIP commits, are they categorized into other changes? but they're not actually, so I need squash those commits before push to origin?
There also might be failure on bugfixes, so will there be multiple entries in the changelog like: fix: something and another same one or similar one fix: something again?

@volkertb
Copy link
Collaborator Author

Hi @crazii, sorry for the late reply!

To answer your questions:

  • No need to enforce restrictions from others. If they don't follow the Conventional Commits convention, their commits will just end up under "Other Changes". Not ideal, but the commits will still be listed in each release.
  • Whether or not to squash your commits is best to be judged by you. But indeed, if multiple "work in progress" commits end up making a single feature or fix, you might want to squash them if you prefer to have one commit listed for those incremental changes combined. But I don't think it's that big a deal if you don't want to squash them.
  • As for requiring multiple attempts to fix something: well, I'm sure most users understand that that happens sometimes. You can clarify that in the later fix, like fix: soundcard x compatibility, for real now :). Nothing wrong with a little humor, right? 😉

Shall I just merge this and then we evaluate it going forward? I intend to improve and fine-tune it further as needed, and we can always revert it if need be. Just be aware of the git tagging that you need to perform whenever you are ready to perform another release. No longer will a release automatically be generated for each push or merge to main.

Let me know if you're okay with merging and trying this out for awhile.

Thanks! 🙂

@crazii
Copy link
Owner

crazii commented Apr 6, 2024

the beta4 is planned to be released in a couple of days maybe, I think this PR better merged after beta4 release, leaving beta4 with a manually created changelog, and the auto changelog feature will be merged & tested before next release after beta4.
what's your opinion on it? is it better to merge it right now and test it?

@crazii
Copy link
Owner

crazii commented Apr 29, 2024

It seems you're busy, no worries,
I added a manual changelog for beta4, and after beta4 this PR will be merged. :D

@volkertb
Copy link
Collaborator Author

Hi @crazii. Sorry for the late reply. If you believe that this PR is better merged after the beta4 release, then let's do that. Thanks! 🙂

@crazii
Copy link
Owner

crazii commented May 1, 2024

OK, I'll get beta4 done and merge it soon.

@volkertb
Copy link
Collaborator Author

Hi @crazii.

Now that you have released beta4, is anything blocking us from merging this?

Asking, since you hadn't pressed the merge button yet. I can also do it, but I want to make sure you're okay with it being merged at this point.

Thanks.

@volkertb
Copy link
Collaborator Author

Oh, maybe you can also approve the PR? Thanks.

@crazii crazii merged commit e7ceae4 into crazii:main May 22, 2024
1 check passed
@crazii
Copy link
Owner

crazii commented May 22, 2024

I forgot merging it after resolving conflicts.

@volkertb
Copy link
Collaborator Author

Thank you @crazii ! Let's see how well it works with the next few releases, and then evaluate. I'm happy to improve and tweak this in another PR if and when needed. 👍

@volkertb
Copy link
Collaborator Author

@crazii As a reminder: from now on, you need to explicitly git tag a release and push the tag, before a release is built. A new release will no longer automatically be built and published on each push to main.

The upside of this is that you are in control of when a new release is ready.

See the post I shared earlier in this MR thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish USB image only when a release is tagged
2 participants