Skip to content

Commit

Permalink
fix release notes generation on github release workflow (#7515)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Apr 9, 2024
1 parent 988c360 commit f5719ed
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch: # this is useful to re-generate the release page without a new tag being pushed
push:
tags:
- "v2.0.0-beta*"
- "v2.[0-9]+.[0-9]+*"

jobs:
generate-notes:
Expand All @@ -28,9 +28,33 @@ jobs:
python -m pip install --upgrade pip
pip install "reno<5"
- name: Generate release notes for beta versions
- name: Generate release notes for release candidates - minor releases
if: steps.version.outputs.current_pre_release != '' && endsWith(steps.version.outputs.current_release, '.0')
env:
# When generating notes for release candidates of minor versions, pick every vX.Y.Z-rcN but
# stop when encounter vX.Y.Z-rc0. The -rc0 tag is added automatically when
# we create the release branch, so we can assume it's always there.
EARLIEST_VERSION: v${{ steps.version.outputs.current_release }}-rc0
run: |
reno report --no-show-source --ignore-cache --version v${{ steps.version.outputs.current_release }}-${{ steps.version.outputs.current_pre_release }} -o relnotes.rst
reno report --no-show-source --ignore-cache --earliest-version "$EARLIEST_VERSION" -o relnotes.rst
- name: Generate release notes for release candidates - bugfix releases
if: steps.version.outputs.current_pre_release != '' && !endsWith(steps.version.outputs.current_release, '.0')
env:
# When generating notes for release candidates of bugfix releases, pick every vX.Y.Z-rcN but
# stop when encounter vX.Y.Z-rc1.
# In this case, we don't have the -rc0 tag, because we don't need to go through commits on main,
# as we cherry-pick them into the release branch.
EARLIEST_VERSION: v${{ steps.version.outputs.current_release }}-rc1
run: |
reno report --no-show-source --ignore-cache --earliest-version "$EARLIEST_VERSION" -o relnotes.rst
- name: Generate release notes for the final release
if: steps.version.outputs.current_pre_release == ''
# When generating notes for the final release vX.Y.Z, we just pass --version and reno
# will automatically collapse all the vX.Y.Z-rcN.
run: |
reno report --no-show-source --ignore-cache --version v${{ steps.version.outputs.current_release }} -o relnotes.rst
- name: Convert to Markdown
uses: docker:https://pandoc/core:3.1
Expand Down

0 comments on commit f5719ed

Please sign in to comment.