diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 708a0c85c..80a3dccb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,6 +127,10 @@ jobs: run: | ls -lRFh artifacts + - name: Generate github release notes + run: | + doc/ghrelnotes ${{ github.ref }} # ref should be the release's main tag name + - name: Create release uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # https://github.com/softprops/action-gh-release 2.0.5 # permissions: @@ -149,7 +153,7 @@ jobs: # append_body Boolean Append to existing body instead of overwriting it # make_latest String Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Can be true, false, or legacy. Uses GitHub api defaults if not provided # - body_path: ${{ github.workspace }}/doc/relnotes.github.md + body_path: doc/ghrelnotes.md files: | artifacts/*.zip artifacts/*.tar.gz diff --git a/.gitignore b/.gitignore index 806f43686..74cf6eb46 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,4 @@ hledger-web/yesod-devel/ /finance /examples/demo/ /hledger-web/demo/ +/doc/ghrelnotes.md diff --git a/doc/relnotes.github.md b/doc/ghrelnotes old mode 100644 new mode 100755 similarity index 74% rename from doc/relnotes.github.md rename to doc/ghrelnotes index 3b6ce08fe..7517e08bd --- a/doc/relnotes.github.md +++ b/doc/ghrelnotes @@ -1,56 +1,16 @@ - +cd "$(dirname $0)" +OUT=ghrelnotes.md +cat >$OUT <<'END' ## Release notes - -### hledger 1.33.1 - -- process >=1.6.19.0 seems not strictly needed and is no longer required, - improving installability. - [#2149] - -- `print` and `close` now show a trailing decimal mark on cost amounts also, - when needed to disambiguate a digit group mark. - -- The balance commands' HTML output now includes digit group marks when - appropriate (fixes a regression in 1.25). - [#2196] - -- The add command no longer shows ANSI escape codes in terminals that - don't support them. - -- Doc updates: - - import: Skipping -> Date skipping, discuss commodity styles more - - csv: Amount decimal places: expand, note import behaviour - -### hledger-ui 1.33.1 - -- Require vty-windows-0.2.0.2+ to avoid display problems in recent - MS Terminal on Windows. - -- process >=1.6.19.0 seems not strictly needed and is no longer required, - improving installability. - [#2149] - -### hledger-web 1.33.1 - -- Support base64 >=1.0 - -### credits 1.33.1 - -- Simon Michael (@simonmichael) - -[#2149]: https://github.com/simonmichael/hledger/issues/2149 -[#2196]: https://github.com/simonmichael/hledger/issues/2196 - +END +export REL=$1 +../tools/getrelnotes $REL >>$OUT +envsubst '$REL' >>$OUT <<'END'
@@ -78,7 +38,7 @@ At the command line, ``` cd /usr/local/bin -curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.33.1/hledger-linux-x64.zip # just rerun if interrupted +curl -LOC- https://github.com/simonmichael/hledger/releases/download/$REL/hledger-linux-x64.zip # just rerun if interrupted unzip hledger-linux-x64.zip && tar xvf hledger-linux-x64.tar && rm -f hledger-linux-x64.{zip,tar} # github workaround, preserves permissions cd hledger --version # should show the new version @@ -106,11 +66,11 @@ and/or [Homebrew](https://brew.sh), and let me know.) cd /usr/local/bin # for ARM macs: -curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.33.1/hledger-mac-arm64.zip # just rerun if interrupted +curl -LOC- https://github.com/simonmichael/hledger/releases/download/$REL/hledger-mac-arm64.zip # just rerun if interrupted unzip hledger-mac-arm64.zip && tar xvf hledger-mac-arm64.tar && rm -f hledger-mac-arm64.{zip,tar} # github workaround, preserves permissions # or for Intel macs: -curl -LOC- https://github.com/simonmichael/hledger/releases/download/1.33.1/hledger-mac-x64.zip +curl -LOC- https://github.com/simonmichael/hledger/releases/download/$REL/hledger-mac-x64.zip unzip hledger-mac-x64.zip && tar xvf hledger-mac-x64.tar && rm -f hledger-mac-x64.{zip,tar} cd @@ -142,7 +102,7 @@ cd $HOME\bin cp hledger.exe hledger.old.exe # keep a backup of the old executables, if you care cp hledger-ui.exe hledger-ui.old.exe cp hledger-web.exe hledger-web.old.exe -curl https://github.com/simonmichael/hledger/releases/download/1.33.1/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip +curl https://github.com/simonmichael/hledger/releases/download/$REL/hledger-windows-x64.zip -OutFile hledger-windows-x64.zip Expand-Archive hledger-windows-x64.zip -DestinationPath . -Force cd $HOME hledger --version # should show the new version @@ -193,3 +153,4 @@ Problems: Once installed, run `hledger`, and perhaps read [hledger.org: Quick start](https://hledger.org/#quick-start).
+END diff --git a/tools/getrelnotes b/tools/getrelnotes new file mode 100755 index 000000000..f6f446213 --- /dev/null +++ b/tools/getrelnotes @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# getrelnotes REL - extract the release notes for REL from relnotes.md. +# The main release heading is omitted. + +cd "$(dirname $0)" +awk "/^## .*-${1//./'\.'}$/{p=1;next} /^## /{p=0} p" ../doc/relnotes.md