1
0
mirror of https://github.com/mfontanini/presenterm.git synced 2026-09-01 23:33:21 -06:00

Include changelog contents in release

This commit is contained in:
Matias Fontanini 2024-01-26 15:08:10 -08:00
parent a96b0325e4
commit c8a7b73fee
2 changed files with 30 additions and 1 deletions

View File

@ -1,4 +1,4 @@
name: Continuous Deployment
name: Release
on:
push:
@ -71,6 +71,16 @@ jobs:
> presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.tar.gz.sha512
fi
- name: Parse release notes
id: read_release_notes
shell: bash
run: |
r=$(./scripts/parse-changelog.sh ${{ github.ref }})
r="${r//'%'/'%25'}"
r="${r//$'\n'/'%0A'}"
r="${r//$'\r'/'%0D'}"
echo "RELEASE_NOTES=$r" >> $GITHUB_OUTPUT
- name: Upload the release
uses: svenstaro/upload-release-action@v2
with:
@ -79,6 +89,8 @@ jobs:
file_glob: true
overwrite: true
tag: ${{ github.ref }}
body: |
${{ steps.read_release_notes.outputs.RELEASE_NOTES }}
publish-crates-io:
name: Publish on crates.io

17
scripts/parse-changelog.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <version>"
exit 1
fi
version=$1
if ! grep "^# ${version}" CHANGELOG.md >/dev/null; then
echo "Version ${version} not found in changelog"
exit 1
fi
sed -n "/^# ${version}/,/^# /{/^# ${version}/p;/^# /b;p}" CHANGELOG.md