Skip to content

Commit 25f104f

Browse files
committed
ci: standardize release presentation and baseline dependencies
1 parent 4c8a3c2 commit 25f104f

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

‎.github/workflows/maven-release.yml‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,26 @@ jobs:
137137
sha256sum --check SHA256SUMS
138138
flags=()
139139
if [[ "$TAG" == *-* ]]; then flags+=(--prerelease); fi
140+
gh api --method POST "repos/$GH_REPO/releases/generate-notes" \
141+
-f tag_name="$TAG" --jq .body > "$RUNNER_TEMP/release-changes.md"
142+
python3 - <<'PY'
143+
import os, re
144+
from pathlib import Path
145+
from urllib.parse import quote
146+
temp = Path(os.environ['RUNNER_TEMP'])
147+
changes = (temp / 'release-changes.md').read_text().strip()
148+
changes = re.sub(r"^## What's Changed\s*", '', changes)
149+
changes = re.sub(r'^(#{1,5}) ', r'\1# ', changes, flags=re.MULTILINE)
150+
lines = ['## Changes', '', changes or 'Initial release.', '', '## Downloads', '']
151+
assets = sorted([*Path('.').glob('*.jar'), *Path('.').glob('*.tar.gz')])
152+
assets += [Path('SHA256SUMS'), Path('build.json')]
153+
base = f"https://github.com/{os.environ['GH_REPO']}/releases/download/{quote(os.environ['TAG'], safe='')}/"
154+
for asset in assets:
155+
if not asset.is_file():
156+
raise SystemExit(f'Missing release asset: {asset}')
157+
description = {'SHA256SUMS': ' — SHA-256 checksums.', 'build.json': ' — Build metadata.'}.get(asset.name, '')
158+
lines.append(f'- [`{asset.name}`]({base}{quote(asset.name)}){description}')
159+
(temp / 'release-notes.md').write_text('\n'.join(lines) + '\n')
160+
PY
140161
gh release create "$TAG" ./*.jar SHA256SUMS build.json \
141-
--verify-tag --draft --title "$TAG" --generate-notes "${flags[@]}"
162+
--verify-tag --draft --title "$TAG" --notes-file "$RUNNER_TEMP/release-notes.md" "${flags[@]}"

‎pom.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<maven.compiler.release>21</maven.compiler.release>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<interactiblefurniture.version>0.2.0-BETA</interactiblefurniture.version>
15-
<rpcharacters.version>2.0.0</rpcharacters.version>
16-
<simplefactions.version>3.0.0</simplefactions.version>
15+
<rpcharacters.version>2.0.1</rpcharacters.version>
16+
<simplefactions.version>3.0.1</simplefactions.version>
1717
<tfmccore.version>2.0.0</tfmccore.version>
1818
<tlibs.version>2.0.0</tlibs.version>
1919
</properties>

0 commit comments

Comments
 (0)