Skip to content

Commit 8b8da54

Browse files
committed
feat: Add automated release
1 parent 2412fd9 commit 8b8da54

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Get previous tag
19+
id: previousTag
20+
run: |
21+
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
22+
echo "previousTag: $name"
23+
echo "previousTag=$name" >> $GITHUB_ENV
24+
25+
- name: Update CHANGELOG
26+
id: changelog
27+
uses: requarks/changelog-action@v1
28+
with:
29+
token: ${{ github.token }}
30+
fromTag: ${{ github.ref_name }}
31+
toTag: ${{ env.previousTag }}
32+
writeToFile: false
33+
34+
- name: Create Release
35+
uses: ncipollo/release-action@v1.12.0
36+
with:
37+
allowUpdates: true
38+
draft: true
39+
makeLatest: true
40+
name: ${{ github.ref_name }}
41+
body: ${{ steps.changelog.outputs.changes }}
42+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)