Skip to content

Commit

Permalink
Extract changelog for release
Browse files Browse the repository at this point in the history
  • Loading branch information
koliyo committed Nov 3, 2023
1 parent 259c1e0 commit fc5c680
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/publish-release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ jobs:
# zip release-artifacts/hylo-lsp-client-windows-x64.zip hylo-lsp-windows-x64/hylo-lsp-client.exe ref
ls -l release-artifacts
- name: Extract version changelog
run: echo "RELEASE_CHANGELOG=$(./extract_version_changelog.sh ${{ github.ref_name }})" >> $GITHUB_ENV

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
LICENSE
release-artifacts/*
body: ${{ env.RELEASE_CHANGELOG }}
14 changes: 14 additions & 0 deletions extract_version_changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

start_heading="## $1"

end_heading="#"

# The file to process
file="CHANGELOG.md"

awk -v start="$start_heading" -v end="$end_heading" '
$0 ~ start {flag=1; next}
$0 ~ end {flag=0}
flag {print}
' "$file"

0 comments on commit fc5c680

Please sign in to comment.