-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (56 loc) · 1.94 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (56 loc) · 1.94 KB
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
61
62
63
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
permissions:
contents: write
actions: read
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
# Checkout the repository branch directly to avoid detached HEAD
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
# 1. Generate release notes for the latest tag only (for GitHub Release body)
- name: Generate Release Notes with git-cliff
id: git-cliff
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip header
env:
GITHUB_REPO: ${{ github.repository }}
# 2. Create the GitHub Release
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: ${{ steps.git-cliff.outputs.content }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
# 3. Generate the full project changelog and write it to CHANGELOG.md
- name: Generate Full CHANGELOG.md
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: -o CHANGELOG.md
env:
GITHUB_REPO: ${{ github.repository }}
# 4. Commit and push the updated CHANGELOG.md back to the repository branch
- name: Commit and Push CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: "docs(changelog): update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
file_pattern: "CHANGELOG.md"
commit_user_name: "github-actions[bot]"
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"