-
Notifications
You must be signed in to change notification settings - Fork 380
Create a GitHub release for each action release #2517
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,17 @@ jobs: | |
# - `--force` since we're overwriting the `vN` tag | ||
git push origin --atomic --force refs/tags/"${VERSION}" refs/tags/"${major_version_tag}" | ||
|
||
- name: Prepare partial Changelog | ||
env: | ||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" | ||
VERSION: "${{ steps.getVersion.outputs.version }}" | ||
run: | | ||
python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION" > $PARTIAL_CHANGELOG | ||
|
||
echo "::group::Partial CHANGELOG" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏻 I like this change! Makes it easier to see what the changelog looked like at the time of generation! |
||
cat $PARTIAL_CHANGELOG | ||
echo "::endgroup::" | ||
|
||
- name: Create mergeback branch | ||
if: ${{ steps.check.outputs.exists != 'true' && endsWith(github.ref_name, steps.getVersion.outputs.latest_release_branch) }} | ||
env: | ||
|
@@ -151,24 +162,15 @@ jobs: | |
--assignee "${GITHUB_ACTOR}" \ | ||
--draft | ||
|
||
|
||
- name: Prepare the partial Changelog | ||
env: | ||
VERSION: "${{ steps.getVersion.outputs.version }}" | ||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" | ||
run: | | ||
# Prepare the partial changelog for the release notes | ||
python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION"> $PARTIAL_CHANGELOG | ||
|
||
- name: Create the GitHub release | ||
env: | ||
VERSION: "${{ steps.getVersion.outputs.version }}" | ||
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" | ||
VERSION: "${{ steps.getVersion.outputs.version }}" | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Do not mark this release as latest. The most recent CLI release must be marked as latest. | ||
gh release create \ | ||
"$VERSION" \ | ||
--latest=false \ | ||
-t "$VERSION" \ | ||
-F "$PARTIAL_CHANGELOG" | ||
--title "$VERSION" \ | ||
--notes-file "$PARTIAL_CHANGELOG" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just one nitpick, can be merged as is:
I think we can pull this at a higher level in the workflow file, and then the
PARTIAL_CHANGELOG
variable will be shared between the different steps. The benefit this brings is that if at any point we need to change it, it will be changed at both of the steps that require the same file, instead of having to change two separate definitions of the variable, minimising the chance of the two variables being out of sync and causing a bug by accident.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 tried that earlier and unfortunately, and
runner.temp
is not initialized at the job level. I thought this way was safer than trying to hard code the temp directory.