Skip to content

Commit

Permalink
Fix release notes (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmenezes authored Jul 28, 2020
1 parent cf8c7e0 commit 7967085
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ jobs:
- name: Set $TAG env var
run: echo "${{github.ref}}" | sed 's/refs\/tags\///' | xargs -I $ echo "::set-env name=TAG::$"

- name: Set $PREVIOUS_TAG env var
run: git tag --sort=refname | grep $TAG -B 1 | grep -m1 "" | xargs -I $ echo "::set-env name=PREVIOUS_TAG::$"

- name: Generate list of changes
run: |
cat > release.md <<EOF
## Changes
$(git log $TAG...$PREVIOUS_TAG --format="- [%h](../../commit/%h) %s")
EOF
run: scripts/generate_release_notes.sh > .release.md

- name: Generate build files
uses: thatisuday/go-cross-build@v1
Expand All @@ -45,7 +38,7 @@ EOF
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: ./release.md
body_path: ./.release.md

- name: Upload Release Asset (darwin-amd64)
uses: actions/upload-release-asset@v1
Expand Down
14 changes: 14 additions & 0 deletions scripts/generate_release_notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

if [ -z "$TAG" ]
then
echo "\$TAG is empty"
exit 1
fi

export PREVIOUS_TAG=$(git tag --sort=refname | grep $TAG -B 1 | grep -m1 "")

cat <<EOF
## Changes
$(git log $TAG...$PREVIOUS_TAG --format="- [%h](../../commit/%h) %s")
EOF

0 comments on commit 7967085

Please sign in to comment.