diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 698162a6..ef02d6c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,14 +27,11 @@ jobs: run: git fetch --prune --unshallow - name: 'Create Release Notes' + uses: sifive/action-release-notes@v1 id: create-release-notes - run: | - tag=$(echo ${{ github.ref }} | cut -d '/' -f 3) - release_notes=$(./scripts/create-release-notes.sh ${{ env.PROJECT_NAME }} ${tag}) - # The string passed to Actions must urlencode newlines. - release_notes="${release_notes//$'\n'/'%0A'}" - # Use a magic "workflow command" to set the output for the step. - echo "::set-output name=release-notes::${release_notes}" + with: + project-name: ${{ env.PROJECT_NAME }} + release: ${{ github.ref }} - name: 'Create Release' uses: actions/create-release@v1 diff --git a/scripts/create-release-notes.sh b/scripts/create-release-notes.sh deleted file mode 100755 index 8f858112..00000000 --- a/scripts/create-release-notes.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Copyright (c) 2020 SiFive Inc. -# SPDX-License-Identifier: Apache-2.0 - -set -euo pipefail - -if [ "$#" -lt 2 ] ; then - >&2 echo "$0: please provide project name and release tag" - exit 1 -fi - -project=$1; shift 1; -current_release=$1; shift 1; - -# Get the most recent previous tag with git-describe. If this is -# the first tag in the repository, then this will return a commit -# hash (because of the --always flag). -last_release=$(git describe --tags --always HEAD~) - -echo "# Release notes for ${project} ${current_release}" -echo "## Statistics since ${last_release}" -echo "- $(git rev-list --count ${last_release}..HEAD) commits" -echo "-$(git diff --shortstat ${last_release} HEAD)" -echo "" -echo "## Authors" -git shortlog -s -n --no-merges ${last_release}..HEAD | cut -f 2 -echo "" -echo "## Merge history" -git log --merges --pretty=format:"%h %b" ${last_release}..HEAD