Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ydaydada committed Jun 16, 2021
1 parent aa02e67 commit 630d0fb
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release-by-push-tag.yml
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

0 comments on commit 630d0fb

Please sign in to comment.