Skip to content

Commit 9c6df79

Browse files
authored
fix: fix release notes aggregation during releases (#10107)
1 parent 2dcacce commit 9c6df79

1 file changed

Lines changed: 17 additions & 21 deletions

File tree

.github/workflows/github_release.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,30 @@ jobs:
2929
python -m pip install --upgrade pip
3030
pip install "reno<5"
3131
32-
- name: Generate release notes for release candidates - minor releases
33-
if: steps.version.outputs.current_pre_release != '' && endsWith(steps.version.outputs.current_release, '.0')
34-
env:
35-
# When generating notes for release candidates of minor versions, pick every vX.Y.Z-rcN but
36-
# stop when encounter vX.Y.Z-rc0. The -rc0 tag is added automatically when
37-
# we create the release branch, so we can assume it's always there.
38-
EARLIEST_VERSION: v${{ steps.version.outputs.current_release }}-rc0
32+
# Remove next version rc0 tag in the CI environment to prevent reno from assigning notes to future releases.
33+
# This ensures release notes are correctly aggregated for the current version.
34+
# This is a workaround. Can be removed if the release process is fully aligned with reno.
35+
- name: Delete next version rc0 tag in the CI environment
3936
run: |
40-
reno report --no-show-source --ignore-cache --earliest-version "$EARLIEST_VERSION" -o relnotes.rst
37+
# Parse version X.Y.Z and increment Y for next minor version
38+
IFS='.' read -r MAJOR MINOR _ <<< "${{ steps.version.outputs.current_release }}"
39+
NEXT_MINOR=$((MINOR + 1))
40+
NEXT_TAG="v${MAJOR}.${NEXT_MINOR}.0-rc0"
41+
42+
if git rev-parse --verify "$NEXT_TAG" >/dev/null 2>&1; then
43+
git tag -d "$NEXT_TAG"
44+
echo "Deleted local tag $NEXT_TAG"
45+
else
46+
echo "Tag $NEXT_TAG does not exist locally"
47+
fi
4148
42-
- name: Generate release notes for release candidates - bugfix releases
43-
if: steps.version.outputs.current_pre_release != '' && !endsWith(steps.version.outputs.current_release, '.0')
49+
- name: Generate release notes
4450
env:
45-
# When generating notes for release candidates of bugfix releases, pick every vX.Y.Z-rcN but
46-
# stop when encounter vX.Y.Z-rc1.
47-
# In this case, we don't have the -rc0 tag, because we don't need to go through commits on main,
48-
# as we cherry-pick them into the release branch.
51+
4952
EARLIEST_VERSION: v${{ steps.version.outputs.current_release }}-rc1
5053
run: |
5154
reno report --no-show-source --ignore-cache --earliest-version "$EARLIEST_VERSION" -o relnotes.rst
5255
53-
- name: Generate release notes for the final release
54-
if: steps.version.outputs.current_pre_release == ''
55-
# When generating notes for the final release vX.Y.Z, we just pass --version and reno
56-
# will automatically collapse all the vX.Y.Z-rcN.
57-
run: |
58-
reno report --no-show-source --ignore-cache --version v${{ steps.version.outputs.current_release }} -o relnotes.rst
59-
6056
- name: Convert to Markdown
6157
uses: docker://pandoc/core:3.8
6258
with:

0 commit comments

Comments
 (0)