Skip to content

Commit

Permalink
Adding changelog generation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexejk committed Dec 30, 2019
1 parent 68dcdf2 commit 4bea382
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ jobs:
run: |
make build-in-docker
- name: Release
- name: Generate Changelog
run: |
VERSION=$(hack/version.sh)
hack/changelog.sh $VERSION > build/${{ github.workflow }}-CHANGELOG.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body_path: build/${{ github.workflow }}-CHANGELOG.md
files: build/portal-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## (unreleased)

_TBD_

## 0.0.1

Initial release with support for basic connections and tunneling operations.

28 changes: 28 additions & 0 deletions hack/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

MARKER_PREFIX="##"
VERSION=$(echo "$1" | sed 's/^v//g')

IFS=''
found=0

cat CHANGELOG.md | while read "line"; do

# If not found and matching heading
if [ $found -eq 0 ] && echo "$line" | grep -q "^$MARKER_PREFIX $VERSION$"; then
found=1
continue
fi

# If needed version if found, and reaching next delimter - stop
if [ $found -eq 1 ] && echo "$line" | grep -q -E "^$MARKER_PREFIX [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+"; then
found=0
break
fi

# Keep printing out lines as no other version delimiter found
if [ $found -eq 1 ]; then
echo "$line"
fi

done

0 comments on commit 4bea382

Please sign in to comment.