Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Jul 7, 2022
1 parent 7adc7fd commit 16bb061
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,3 @@ jobs:
branch: master
tags: true
timeout: 20

- name: Extract changelog
run: |
git diff HEAD~1 HEAD --exit-code -- CHANGELOG.md | \
tail -n +5 | \
grep -E "^\+" | \
sed -E 's/^\+//' | \
cat -s \
> /tmp/changelog.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.BOT_PAT }}
body_path: /tmp/changelog.txt
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
tags:
- v*.*.*

concurrency:
group: release-${{ github.ref }}

jobs:
create-github-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Extract changelog
run: |
git diff HEAD~1 HEAD --exit-code -- CHANGELOG.md | \
tail -n +5 | \
grep -E "^\+" | \
sed -E 's/^\+//' | \
cat -s \
> /tmp/changelog.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.BOT_PAT }}
body_path: /tmp/changelog.txt

0 comments on commit 16bb061

Please sign in to comment.