diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 148ff8748..f7522a497 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,7 +1,4 @@ # Cut a release whenever a new tag is pushed to the repo. -# You should use an annotated tag, like `git tag -a v1.2.3 --cleanup=whitespace` -# and put the release notes into the commit message for the tag. -# The `--cleanup` flag avoids markdown headings being stripped as comments. name: Release on: @@ -24,8 +21,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Get version number + id: get-version + run: set -x; echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT + - name: Read section from CHANGELOG.md + id: extract-changelog + uses: sean0x42/markdown-extract@v2 + with: + file: CHANGELOG.md + pattern: ${{ steps.get-version.outputs.version }} - name: Prepare release notes and artifacts - run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt + run: | + .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt + printf '${{ steps.extract-changelog.outputs.markdown }}' >> release_notes.txt - name: Release uses: softprops/action-gh-release@v1 with: