Skip to content

Commit

Permalink
feat(ci): add another job to create GitHub release
Browse files Browse the repository at this point in the history
  • Loading branch information
kory33 committed Nov 26, 2021
1 parent 02449f3 commit 489b350
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 489b350

Please sign in to comment.