-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.58 KB
/
generate_changelog_and_version.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
name: Commit Changelog And Version
on:
push:
branches:
- staging
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Bump version and push tag
id: autoversion
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
WITH_V: false
DRY_RUN: false
INITIAL_VERSION: 0.0.0
outputs:
new_tag: ${{ steps.autoversion.outputs.new_tag }}
commit_changelog_and_version:
needs: tag
runs-on: ubuntu-latest
name: Generate changelog and update version
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a changelog
uses: orhun/git-cliff-action@main
id: git-cliff
with:
config: cliff.toml
args: --latest -t ${{ needs.tag.outputs.new_tag }}
env:
OUTPUT: CHANGES.md
- name: Copy changelog to workspace
run: echo "${{ steps.git-cliff.outputs.content }}" >> CHANGELOG.md
- name: Update blog version in config.toml
run: |
sed -i '/version./c\ version="${{ needs.tag.outputs.new_tag }}"' config.toml
- name: Commit changes
if: ${{ success() }}
uses: EndBug/add-and-commit@v9
with:
add: '["CHANGELOG.md", "config.toml"]'
pull: "--rebase --autostash ."
message: "chore(generated): changelog generated & version updated automatically"
default_author: github_actions