Skip to content

ci: Add workflow to automatically generate release notes for GitHub releases - #3392

Merged
ice0 merged 1 commit into
synfig:masterfrom
akayiz:generate-release-notes
Nov 10, 2024
Merged

ice0 merged 1 commit into
synfig:masterfrom
akayiz:generate-release-notes

Conversation

@akayiz

@akayiz akayiz commented Aug 3, 2024

Copy link
Copy Markdown
Contributor

This is done by adding a simple GitHub workflow that uses the Release Notes Manager GitHub Action which I created for Synfig during Google Summer of Code 2024.

What does this do?

Why is this beneficial?

  • Free up valuable time by removing the burden of modifying release notes manually in ChangeLog.md

  • Tremendously improve the looks and structure of the release notes which will help Synfig users better understand the changes made

  • Transfers the release notes to the GitHub releases' descriptions, increasing their visibility and professionalism

Notes

  • Instructions for generating release notes with this workflow can be found starting from step 5 in the How To Use section.

  • The current version of the Release Notes Manager GitHub Action is specifically designed for Synfig and offers limited customization from the workflow in this repository. Additional customization features can be added later after closing issue #3377

@akayiz
akayiz force-pushed the generate-release-notes branch from f876b29 to 7b0836d Compare October 20, 2024 08:21
@mohamedAdhamc

Copy link
Copy Markdown
Member

Hello @Ahmed-Khaled-dev ,

I did a small test:

releases:
Screenshot from 2024-10-20 18-29-58

release note generator:
gen

error:
Screenshot from 2024-10-20 18-37-02

Any idea what is happening here ?

@akayiz

akayiz commented Oct 20, 2024

Copy link
Copy Markdown
Contributor Author

Hello Mohamed!
Thank you for the images that clarify the test,
If you are testing this with Synfig's commit messages, then this wouldn't be an error since all the commit messages between v1.4.2 and v1.5.1 don't follow conventional commit types, you can check the commits between these 2 releases by running git log v1.4.2..v1.5.1 --oneline, it will print all the commit messages of all the commits that happened between these 2 releases, and all of them don't follow conventional commit types, I would suggest testing generating release notes between v1.4.3, v1.4.4, and v1.4.5 since these contain commits that follow conventional commit types,
or if you would like to you can create new commits and tags and test on these, only one thing to keep in mind is to follow the convention that Synfig uses in commit messages as shown below:

Screenshot from 2024-10-20 22-26-00

On another note, in case you run into this, if you have correctly formatted commit messages between the 2 tags and it still gives an error, this would probably be due to permission issues, I mentioned the fix to this in the Release Notes Manager README as follows:

image

@mohamedAdhamc

Copy link
Copy Markdown
Member

all the commit messages between v1.4.2 and v1.5.1 don't follow conventional commit types

Yes, correct. I forgot about that. I'll retest with newer version.

@mohamedAdhamc
mohamedAdhamc self-requested a review October 21, 2024 11:22

@mohamedAdhamc mohamedAdhamc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things come to mind here as of now:

1- I think it would be a lot simpler if instead of manually typing the tag name of the release. There would be a drop down selection menu that just lists out all of them from latest to first. Do you think this could be simple to implement ?

**it's not crucial the idea just came to mind when I kept going back and forth and had multiple "release not found" errors.

2- I believe the last selection only affects the PR mode. Instead of writing that, couldn't you just hide it in the other mode ?

@akayiz

akayiz commented Oct 22, 2024

Copy link
Copy Markdown
Contributor Author

These are great suggestions that I also considered when creating the workflow. Unfortunately, neither of them is currently supported by GitHub, and there isn't a clean workaround. I'll explain further below.

I think it would be much simpler if instead of manually typing the tag name of the release. There would be a drop down selection menu that just lists out all of them from latest to first. Do you think this could be simple to implement?

GitHub currently doesn't support dynamically adding values to workflow inputs, the feature that you are suggesting and that also I wanted to add while creating the workflow is a feature wanted by a lot of people in the GitHub community.

There is a famous GitHub discussion discussing the possibility of implementing this, the answer to the discussion isn't suitable for our case, since we want the tag names to be listed in both drop-down menus for new and old releases and also for the below reason:

image

In this discussion GitHub mentioned that they added this feature in their backlog and that they will consider implementing it, away from GitHub officially implementing it, there are other workarounds like creating a local script that you use instead of the GitHub workflow UI and there you can choose tags more easily and when you finish it would execute the GitHub workflow using the GitHub API, but I believe listing the tags is not worth using an external tool instead of the clean GitHub UI and sacrificing having everything in one place on GitHub.

There is also another workaround done in this GitHub Action in which whenever a new tag is created in the GitHub repo, it updates the workflow file and adds this new tag as an option in the tags drop-down menu, but this would lead to a new commit whenever a new tag is created and risks introducing errors in the workflow file. Given the drawbacks, I recommend sticking with the current setup until GitHub officially supports dynamic input, especially since this is used occasionally when creating a new release.

I believe the last selection only affects the PR mode. Instead of writing that, couldn't you just hide it in the other mode?

I considered this as well, but GitHub doesn't support conditionally hiding inputs yet. It's another highly requested feature, as noted in this discussion. Hopefully, GitHub will implement it soon, but for now, the current approach works well enough. 😄

@mohamedAdhamc

mohamedAdhamc commented Oct 23, 2024 •

Copy link
Copy Markdown
Member

Ok, now the action runs successfully and everything. It says to check the release_notes.md/.html file. However, no such files are present. Any idea as to what is happening or where I should be looking for it ?

@akayiz

akayiz commented Oct 24, 2024

Copy link
Copy Markdown
Contributor Author

Screenshot from 2024-10-24 12-32-02

If the GitHub Action ran successfully, you should see the generated markdown release notes added as the description of the new release. Here, as an example, on this release, you should see the markdown release notes added instead of the sentence "Release version 1.5.1," and you should see the HTML release notes file added as an asset in the new release.

It says "check the release_notes.md/.html file" since the first step in the below image only generates the release notes and outputs them in files in the GitHub Action runner/server. The following 2 steps are the ones that take release_notes.md and use its content to update the new release description and take release_notes.html and adds it as an asset to the new release.

image

@mohamedAdhamc

Copy link
Copy Markdown
Member

Oh, yes I see what you mean. I'll do a little more testing, and then I think we should be good here.

@mohamedAdhamc

Copy link
Copy Markdown
Member

Ok, I did some other tests on a new repository. It looks good.

This was from the first to the second tag
Screenshot from 2024-11-04 19-56-11

This was from the first to the third tag (note the extra refactor)
Screenshot from 2024-11-04 19-56-21

I also did some further testing in my Synfig fork. Seems to behave as expected.

@mohamedAdhamc mohamedAdhamc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, works as expected.

@ice0
ice0 merged commit 29c9534 into synfig:master Nov 10, 2024
@ice0

ice0 commented Nov 10, 2024

Copy link
Copy Markdown
Collaborator

Merged. Thanks for the awesome contribution!

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.

3 participants