-
Notifications
You must be signed in to change notification settings - Fork 26k
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
Add a workflow for creating GitHub release notes #1146
base: master
Are you sure you want to change the base?
Conversation
Welcome to GitGitGadgetHi @mahozad, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests. Please make sure that your Pull Request has a good description, as it will be used as cover letter. Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:
It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code. Contributing the patchesBefore you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form Both the person who commented An alternative is the channel
Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment If you want to see what email(s) would be sent for a After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail). If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the curl -g --user "<EMailAddress>:<Password>" \
--url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):
To send a new iteration, just add another PR comment with the contents: Need help?New contributors who want advice are encouraged to join [email protected], where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join. You may also be able to find help in real time in the developer IRC channel, |
There is an issue in commit 4028a7f: |
Please fix this, GitGitGadget gave good advice about it:
Also, please fix https://github.com/git/git/runs/4315074301?check_suite_focus=true#step:3:33:
|
4028a7f
to
c051426
Compare
There is an issue in commit c051426: |
c051426
to
1c9a0e7
Compare
There is an issue in commit 1c9a0e7: |
GitHub now allows users to subscribe only to "release" notifications of a repository. So, users can be notified of new releases and their changelog/release notes automatically. This workflow works whenever: a new version tag (with the format following the regex "v\d+\..*") is pushed to the repository AND the commit that the tag points to, created/modified a release notes file from Doumentation/RelNotes/ directory. The script for generating the temporary changelog file is written in Kotlin language which can be a much better alternative to shell scripts in terms of features and readability (it is like a python script but with static typing support). The Kotlin runner is pre-installed in GitHub Actions environments; for more information see https://github.com/actions/virtual-environments/ https://stackoverflow.com/a/69116750/8583692 The "Release Notes (yyyy-MM-dd)" link in https://git-scm.com/ website can also link to these GitHub release pages instead of to the raw .txt release note file in the repository. See the issue related to GitHub release notifications: isaacs/github#410 Also see GitHub announcement for this feature: https://github.blog/changelog/2018-11-27-watch-releases/ Signed-off-by: Mahdi Hosseinzadeh <[email protected]>
1c9a0e7
to
e2cf343
Compare
@dscho Fixed the issues. |
/allow |
User mahozad is now allowed to use GitGitGadget. WARNING: mahozad has no public email address set on GitHub |
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little convoluted for what it's trying to achieve.
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 # OR '0' To retrieve all preceding commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2? And why ddo we need that comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is not needed. The action only fetches a single revision by default (fetch-depth: 1
). To get the list of modified files, tj-actions/[email protected] needed last two revisions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will give you the list of files modified in the tip commit. Not between tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly.
on: | ||
push: | ||
tags: | ||
- v[0-9]+.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we filter out release candidates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is up to you or other repository owners.
But I think there is no problem publishing release candidates too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I think there is no problem publishing release candidates too.
I do see a rather big problem publishing them as full releases: https://github.com/git/git/releases/latest would then point to a pre-release, not the latest full release. That's not desirable.
release_name: ${{ github.ref_name }} | ||
body_path: changelog.txt | ||
draft: false | ||
prerelease: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to include release candidates, shouldn't they be marked as pre-releases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to do that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did not take a lot of research on my part to find https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-ignoring-branches-and-tags...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did not take a lot of research on my part to find https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-ignoring-branches-and-tags...
Sorry, that was meant as a comment on #1146 (comment)
About prerelease: false
conditional on full releases: you add a run:
step before this one that sets an environment variable to true
when running on an -rc
version and otherwise false
, then use ${{ env.<name> }}
here.
|
||
notesFile | ||
?.copyTo(File("changelog.txt")) | ||
?: println("No release notes file modified in this commit") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we care if the file was changed? We know its location either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the created/modified file to changelog.txt and then used that in body_path: changelog.txt
.
I'm not good at command line.
Maybe there is a better way so the file name can be directly inserted in body_path:
parameter.
with: | ||
separator: ' ' | ||
- name: Generate the changelog | ||
run: kotlin .github/scripts/generate-github-changelog.main.kts ${{ steps.changed-files.outputs.all_changed_and_modified_files }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to spin up a jvm and run 20 lines of kotlin to copy a single file? What does kotlin get us that cp
doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even more importantly, why introduce yet another language into a code base that does not suffer from a shortage of languages used: C, Perl, Shell, Python, Makefile, Javascript, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right.
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: ${{ github.ref_name }} | ||
body_path: changelog.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need to copy the file? Can't we just use Documentation/RelNotes/${GITHUB_REF#refs/tags/v}.txt
directly here and drop the previous two steps completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, you're right. The whole workflow can probably be simplified.
Could anyone please do that?
I just wanted to be notified of new releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could anyone please do that?
Yes: you can do that.
I just wanted to be notified of new releases.
Sure. And you can still make this happen.
I know, I know. But sending a reply to the list requires me to be at home, whereas I can write GitHub reviews from my phone. |
On the Git mailing list, Matthias Aßhauer wrote (reply to this):
|
User |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
User |
On the Git mailing list, Matthias Aßhauer wrote (reply to this):
|
User |
Also see github/roadmap#247. |
On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
|
User |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Fabian Stelzer wrote (reply to this):
|
User |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Fabian Stelzer wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
Because this is not directly the git code and is related to GitHub CI, I post it here.
This pull request adds a new GitHub Actions workflow that automatically creates releases on GitHub repository when pushing a new tag to the repository.
GitHub now allows users to subscribe only to "release" notifications of a repository.
So, users can be notified of new releases and their changelog/release notes automatically.
This workflow works whenever:
a new version tag (with the format following the regex
v\d+\..*
) is pushed to the repositoryAND
the commit that the tag points to, created/modified
a release notes file from Doumentation/RelNotes/ directory.
The script for generating the temporary changelog file is
written in Kotlin language which can be a better alternative
to shell scripts in terms of features and readability
(it is like a python script but with static typing support).
The Kotlin runner is pre-installed in GitHub Actions environments; for more information see
https://github.com/actions/virtual-environments/
https://stackoverflow.com/a/69116750/8583692
The Release Notes (yyyy-MM-dd) link in https://git-scm.com/
website can also link to these GitHub release pages instead of
to the raw .txt release note file in the repository.
See the issue related to GitHub release notifications:
isaacs/github#410
Also see GitHub announcement for this feature:
https://github.blog/changelog/2018-11-27-watch-releases/
cc: Matthias Aßhauer [email protected]
cc: Johannes Schindelin [email protected]
cc: Matthias Aßhauer [email protected]
cc: Ævar Arnfjörð Bjarmason [email protected]
cc: Fabian Stelzer [email protected]