From 09a0fec48b54b5538353300dda92a6caed99947d Mon Sep 17 00:00:00 2001 From: Ryan Barlow <7389646+ryanbarlow97@users.noreply.github.com> Date: Tue, 22 Sep 2026 21:41:34 +0000 Subject: [PATCH] ci: standardize release presentation and baseline dependencies --- .github/workflows/maven-release.yml | 23 ++++++++++++++++++++++- pom.xml | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index fb3a97c..34f05f6 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -137,5 +137,26 @@ jobs: sha256sum --check SHA256SUMS flags=() if [[ "$TAG" == *-* ]]; then flags+=(--prerelease); fi + gh api --method POST "repos/$GH_REPO/releases/generate-notes" \ + -f tag_name="$TAG" --jq .body > "$RUNNER_TEMP/release-changes.md" + python3 - <<'PY' + import os, re + from pathlib import Path + from urllib.parse import quote + temp = Path(os.environ['RUNNER_TEMP']) + changes = (temp / 'release-changes.md').read_text().strip() + changes = re.sub(r"^## What's Changed\s*", '', changes) + changes = re.sub(r'^(#{1,5}) ', r'\1# ', changes, flags=re.MULTILINE) + lines = ['## Changes', '', changes or 'Initial release.', '', '## Downloads', ''] + assets = sorted([*Path('.').glob('*.jar'), *Path('.').glob('*.tar.gz')]) + assets += [Path('SHA256SUMS'), Path('build.json')] + base = f"https://github.com/{os.environ['GH_REPO']}/releases/download/{quote(os.environ['TAG'], safe='')}/" + for asset in assets: + if not asset.is_file(): + raise SystemExit(f'Missing release asset: {asset}') + description = {'SHA256SUMS': ' — SHA-256 checksums.', 'build.json': ' — Build metadata.'}.get(asset.name, '') + lines.append(f'- [`{asset.name}`]({base}{quote(asset.name)}){description}') + (temp / 'release-notes.md').write_text('\n'.join(lines) + '\n') + PY gh release create "$TAG" ./*.jar SHA256SUMS build.json \ - --verify-tag --draft --title "$TAG" --generate-notes "${flags[@]}" + --verify-tag --draft --title "$TAG" --notes-file "$RUNNER_TEMP/release-notes.md" "${flags[@]}" diff --git a/pom.xml b/pom.xml index 529e897..6576a49 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ 21 UTF-8 - 0.2.0-ALPHA + 0.2.1-ALPHA 0.2.0 2.0.0