-
Notifications
You must be signed in to change notification settings - Fork 42
57 lines (51 loc) · 1.53 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
name: Release
on:
push:
tags:
- "v*"
jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 0
token: ${{ secrets.CHANGELOG_PUSH_TOKEN }}
- name: Generate changelog
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose --bump
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 add CHANGELOG.md
git commit -m "ci: update changelog"
git push
- name: Generate release notes
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: --verbose --github-repo ${{ github.repository }} --current --strip header footer --output "release.md"
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRERELEASE: ${{ contains(github.ref_name, '-') }}
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--prerelease ${{ env.PRERELEASE }} \
--latest false \
--notes-file release.md \
--verify-tag