-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (34 loc) · 998 Bytes
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
permissions:
contents: write
on:
push:
branchs:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get version and changes
run: |
changelog_contents=""
inside_section=false
while IFS= read -r line; do
if [[ $line == "# Version "* ]]; then
if [ "$inside_section" = false ]; then
inside_section=true
else
break
fi
fi
if [ "$inside_section" = true ] && [[ $line != "# Version"* ]]; then
changelog_contents="$changelog_contents$line"$'\n'
fi
done < changelog.md
echo "$changelog_contents" > latest.md
echo "version=$(cat module.json | jq -r .version)" >> $GITHUB_ENV
- uses: softprops/action-gh-release@v1
with:
body_path: latest.md
tag_name: v${{ env.version }}
files: module.json