-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ydaydada
committed
Jun 16, 2021
1 parent
aa02e67
commit 630d0fb
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: release by push tag | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: checkout with node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: Get 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: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
${{ steps.get-commit-summary.outputs.COMMIT_SUMMARY }} | ||
draft: false | ||
prerelease: false |