diff --git a/.github/workflows/ci-and-release.yml b/.github/workflows/ci-and-release.yml index 166ce5fc..2abdf48e 100644 --- a/.github/workflows/ci-and-release.yml +++ b/.github/workflows/ci-and-release.yml @@ -82,3 +82,37 @@ jobs: # publish to local repository, and then release bundle sbt "publishSigned; releaseSonatypeBundle" + + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + + - name: Get commit summary + id: get_commit_summary + run: | + PREVIOUS_TAG=$(git tag --sort=-creatordate | sed -n 2p) + echo "PREVIOUS_TAG: $PREVIOUS_TAG" + COMMIT_SUMMARY="$(git log --oneline --pretty=tformat:"%h %s" $PREVIOUS_TAG..${{ github.ref }})" + COMMIT_SUMMARY="${COMMIT_SUMMARY//$'\n'/'%0A'}" + echo ::set-output name=COMMIT_SUMMARY::$COMMIT_SUMMARY + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.get_version.outputs.VERSION }} + name: Release ${{ steps.get_version.outputs.VERSION }} + body: | + ${{ steps.get_commit_summary.outputs.COMMIT_SUMMARY }} + draft: false + prerelease: false