-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.83 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Setup Custom Action Release
on:
push:
tags:
- "v*.*.*"
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Tag Version
id: tag_version
run: echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Generate Full Changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
- name: Commit Changelog
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git switch main
git add CHANGELOG.md
git commit -m "chore(release-bot): prepare for release notes on ${CURRENT_TAG}"
git push
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Latest Release Notes
id: latest_release_notes
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip all
env:
OUTPUT: CHANGELOG.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.txt