-
Notifications
You must be signed in to change notification settings - Fork 9
101 lines (92 loc) · 3.41 KB
/
changelog.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Generate changelog
on:
push:
branches: [ master, staging ]
pull_request:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate the full changelog
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: cliff.toml
args: --verbose --exclude-path "data/" --bump
env:
OUTPUT: CHANGELOG-cliff.md
GITHUB_REPO: ${{ github.repository }}
# - name: Generate latest changes
# uses: orhun/git-cliff-action@v4
# id: git-cliff-latest
# with:
# config: cliff.toml
# args: --verbose --exclude-path "data/" --bump --unreleased
# env:
# GITHUB_REPO: ${{ github.repository }}
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
add-paths: |
CHANGELOG-cliff.md
base: master
commit-message: Update changelog
signoff: false
branch: chore/update-changelog-${{ steps.git-cliff.outputs.version }}
delete-branch: true
title: 'chore(release): Release ${{ steps.git-cliff.outputs.version }}'
body: ${{ steps.git-cliff.outputs.content }}
labels: |
pending-release
automated pr
# - name: Commit the changelog
# run: |
# git checkout ${{ steps.extract_branch.outputs.branch }}
# git config user.name 'github-actions[bot]'
# git config user.email 'github-actions[bot]@users.noreply.github.com'
# set +e
# git add CHANGELOG-cliff.md
# git commit -m "Update changelog"
# git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${{ steps.extract_branch.outputs.branch }}
#
# - name: Tag the next version
# run: |
# git checkout ${{ steps.extract_branch.outputs.branch }}
# git config user.name 'github-actions[bot]'
# git config user.email 'github-actions[bot]@users.noreply.github.com'
# set +e
# git tag -f ${{ steps.git-cliff.outputs.version }}-cliff-test
# git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${{ steps.git-cliff.outputs.version }}-cliff-test
#
# - name: Create dist archive
# uses: ./.github/actions/build-release
# id: create-dist-archive
# with:
# tag: ${{ steps.git-cliff.outputs.version }}-cliff-test
# commit_sha: ${{ github.event.pull_request.head.sha }}
# encryption_key: ${{ secrets.ENCRYPTION_KEY }}
# private_ssh_key: ${{ secrets.PRIVATE_SSH_KEY }}
#
#
# - name: Upload the release
# uses: svenstaro/upload-release-action@v2
# with:
# file: ${{ steps.create-dist-archive.outputs.dist-archive}}
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ steps.git-cliff.outputs.version }}-cliff-test
# body: ${{ steps.git-cliff-latest.outputs.content }}
# draft: true