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

Create a GitHub release for each action release #2517

Merged
merged 3 commits into from
Oct 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/workflows/post-release-mergeback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

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.

Copy link
Contributor Author

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.

VERSION: "${{ steps.getVersion.outputs.version }}"
run: |
python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION" > $PARTIAL_CHANGELOG

echo "::group::Partial CHANGELOG"
Copy link
Member

Choose a reason for hiding this comment

The 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:
Expand Down Expand Up @@ -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"
Loading