-
Notifications
You must be signed in to change notification settings - Fork 853
Add Release github action #6434
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
base: main
Are you sure you want to change the base?
Add Release github action #6434
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TomSweeneyRedHat The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@ashley-cui PTAL |
| - name: Checkout the main branch of this repository | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| ref: ${{needs.check.outputs.version}} |
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 duplicated in the step below
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.
Ouch, you're right!
| - name: Touch release notes file | ||
| run: | | ||
| touch $VERSION-release-notes.md |
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 think you need this if you're using the changelog action below
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 need it if they're generating the release note, but I do need it if they decide to pull the release notes from file instead.
| contents: write # REQUIRED to create the release and fetch content | ||
| steps: | ||
| # ... | ||
| 🧩 Key Actions Used (Inferred) |
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 inside the code block, probably need to move it out
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.
Fixed!
.github/workflows/README.md
Outdated
| the "release" workflow in the left windowpane. Once selected, a new window will come up with a `Run workflow` button. Click on this, and answer | ||
| the following questions in the form: | ||
|
|
||
| * **Branch:** Select the branch of the project that you want to create the release from. |
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 think this is gone from the workflow
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.
Cut/paste error, TY for picking that up, now gone.
.github/workflows/README.md
Outdated
| Action Name Purpose | ||
| actions/checkout@v4 Downloads a copy of the repository code to the runner. | ||
| gableroux/[email protected] Generates the Markdown content for the release notes based on the commit history and merged PRs between tags. | ||
| softprops/action-gh-release@v1 Creates the final GitHub Release, publishing the generated notes using the pushed tag name. |
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 also looks wrong, we're using the gh CLI
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.
Yeah, that's gone, and I neglected to tweak checkout, which is not v5. Fixed.
.github/workflows/README.md
Outdated
| Export to Sheets | ||
| 🛑 Troubleshooting | ||
| If the workflow fails with an error, such as the AxiosError: Request failed with status code 404 (a common GitHub API error in release actions), consider the following: | ||
|
|
||
| Check Permissions: Ensure your workflow or specific job has explicitly set permissions: contents: write to allow the default GITHUB_TOKEN to create the release. | ||
|
|
||
| Verify Tags: Confirm that the tag you pushed exactly matches the pattern the workflow is listening for (e.g., v*). | ||
|
|
||
| Previous Tag Existence: For release note generation to work correctly, a previous tag must exist to define the change range. Ensure your repository has at least one prior version 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 doesn't apply, we guarantee buildah has prev versions :)
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 I'm going to keep. We check for the previous version and it's not happy if it doesn't find it.
.github/workflows/README.md
Outdated
| gableroux/[email protected] Generates the Markdown content for the release notes based on the commit history and merged PRs between tags. | ||
| softprops/action-gh-release@v1 Creates the final GitHub Release, publishing the generated notes using the pushed tag name. | ||
|
|
||
| Export to Sheets |
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.
| Export to Sheets |
I was asked to create a GitHub action for the mono repo, and I thought I would create one that could be used for Buildah too. I don't think we will need this for container-libs after all, we'll just be tagging there I think. So I have decided to add this here. I originally created https://github.com/TomSweeneyRedHat/ActionJackson/blob/main/.github/workflows/action_release.yml.finalhold which is based off the release GitHub action that Podman uses, but a little lighter weight. As Buildah doesn't use a RELEASE_NOTES.md like Podman does, I removed that logic from this version of the script. This will create a Release when a tag is pushed upstream, and will generate the release notes in the same way that "Generate release notes" button on the GitHub web interface does, including recognizing new contributors. That is is I did the action correctly! It also has the ability to be run fron the Actions menu, so if you ever want to redo a release, or test creating one without actually creating one, you can do so. Signed-off-by: tomsweeneyredhat <[email protected]>
eb19647 to
bccdcf4
Compare
|
@ashley-cui PTA(nother)L. Thanks for the review, and I completely missed it. |
|
LGTM! :) |
|
@containers/buildah-maintainers need some more loving on this one. |
|
|
||
| # If the job fails, permit the operator to observe the contents if helpful. | ||
| - name: Provide release e-mail contents for examination | ||
| run: cat email_body.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.
Where is email_body.txt file ? I cannot see it in this PR
I was asked to create a GitHub action for the mono repo, and I thought I would create one that could be used for Buildah too. I don't think we will need this for container-libs after all, we'll just be tagging there I think.
So I have decided to add this here. I originally created https://github.com/TomSweeneyRedHat/ActionJackson/blob/main/.github/workflows/action_release.yml.finalhold which is based off the release GitHub action that Podman uses, but a little lighter weight. As Buildah doesn't use a RELEASE_NOTES.md like Podman does, I removed that logic from this version of the script.
This will create a Release when a tag is pushed upstream, and will generate the release notes in the same way that "Generate release notes" button on the GitHub web interface does, including recognizing new contributors. That is is I did the action correctly!
It also has the ability to be run fron the Actions menu, so if you ever want to redo a release, or test creating one without actually creating one, you can do so.
What type of PR is this?
What this PR does / why we need it:
How to verify it
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?