Skip to content

Commit

Permalink
CI: Generate GitHub releases
Browse files Browse the repository at this point in the history
* Increase the checkout depth from 1 to 30 to handle reno needing to be
  able to find all relevant tags (current and current -1) and also pull
  the tags
* Generate a reno report for the given tag and then modify the report to
  strip out all the extra garbage that is added by the report process to
  get it into a valid markdown file and not RST file
* Use `gh` cli tool to generate the release notes using the
  auto-changelog generation plus the reno release notes

Issue: RELENG-4973
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: Ic54ac4a5b138aabe2adcc3a9612f018ed34b4983
  • Loading branch information
tykeal committed Nov 6, 2023
1 parent a9cf02c commit 712e20a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# .github/release.yml

changelog:
categories:
- title: Changes
labels:
- "*"
27 changes: 26 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 30
fetch-tags: true
- name: Configure Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -53,3 +56,25 @@ jobs:
Cheers,
LF Release Engineering
- name: Generate reno report
run: >-
pipx run tox -e reno -- report \
--version "${{ steps.tag.outputs.tag }}" \
2>/dev/null > reno-notes.md || true
if grep -q 'reno: FAIL' reno-notes.md
then
touch modified-reno-notes.md
else
sed '/^\.pkg.*$/d' reno-notes.md |
sed '/^reno:.*$/d' |
sed '/^\.\. .*$/d' |
sed '$d' |
sed '$d' |
sed '1d' > modified-reno-notes.md
fi
- name: Create Release Notes
run: >-
gh release create ${{ steps.tag.outputs.tag }} --generate-notes \
-F modified-reno-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 712e20a

Please sign in to comment.