Skip to content

Commit 4bea382

Browse files
committed
Adding changelog generation
1 parent 68dcdf2 commit 4bea382

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.github/workflows/release.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ jobs:
1717
run: |
1818
make build-in-docker
1919
20-
- name: Release
20+
- name: Generate Changelog
21+
run: |
22+
VERSION=$(hack/version.sh)
23+
hack/changelog.sh $VERSION > build/${{ github.workflow }}-CHANGELOG.md
24+
25+
- name: Create GitHub Release
2126
uses: softprops/action-gh-release@v1
2227
with:
28+
body_path: build/${{ github.workflow }}-CHANGELOG.md
2329
files: build/portal-*.tar.gz
2430
env:
2531
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## (unreleased)
2+
3+
_TBD_
4+
5+
## 0.0.1
6+
7+
Initial release with support for basic connections and tunneling operations.
8+

hack/changelog.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
MARKER_PREFIX="##"
4+
VERSION=$(echo "$1" | sed 's/^v//g')
5+
6+
IFS=''
7+
found=0
8+
9+
cat CHANGELOG.md | while read "line"; do
10+
11+
# If not found and matching heading
12+
if [ $found -eq 0 ] && echo "$line" | grep -q "^$MARKER_PREFIX $VERSION$"; then
13+
found=1
14+
continue
15+
fi
16+
17+
# If needed version if found, and reaching next delimter - stop
18+
if [ $found -eq 1 ] && echo "$line" | grep -q -E "^$MARKER_PREFIX [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+"; then
19+
found=0
20+
break
21+
fi
22+
23+
# Keep printing out lines as no other version delimiter found
24+
if [ $found -eq 1 ]; then
25+
echo "$line"
26+
fi
27+
28+
done

0 commit comments

Comments
 (0)