Skip to content

Commit 6628805

Browse files
committed
up: use the gookit/gitw chlog for generate changelog
1 parent 2772c34 commit 6628805

File tree

3 files changed

+39
-53
lines changed

3 files changed

+39
-53
lines changed

.github/changelog.yml

+29-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
1-
options:
2-
title: '## Change Log'
3-
style: gh-release
1+
title: '## Change Log'
2+
# style allow: simple, markdown(mkdown), ghr(gh-release)
3+
style: gh-release
4+
# group names
5+
names: [Refactor, Fixed, Feature, Update, Other]
6+
#repo_url: https://github.com/gookit/gcli
7+
48
filters:
5-
# message length >= 12
6-
- name: msgLen
7-
minLen: 12
8-
# message words >= 3
9-
- name: wordsLen
10-
minLen: 3
9+
# message length should >= 12
10+
- name: msg_len
11+
min_len: 12
12+
# message words should >= 3
13+
- name: words_len
14+
min_len: 3
15+
- name: keyword
16+
keyword: format code
17+
exclude: true
1118
- name: keywords
12-
keywords: ['format code']
19+
keywords: format code, action test
1320
exclude: true
1421

22+
# group match rules
1523
# not matched will use 'Other' group.
16-
groups:
17-
- name: New
18-
keywords: [add, new]
24+
rules:
25+
- name: Refactor
26+
start_withs: [refactor, break]
27+
contains: ['refactor:']
1928
- name: Fixed
20-
startWiths: [add, new]
21-
keywords: [add, new]
22-
- name: Feat
23-
startWiths: [feat]
24-
keywords: [feature]
29+
start_withs: [fix]
30+
contains: ['fix:']
31+
- name: Feature
32+
start_withs: [feat, new]
33+
contains: [feature]
2534
- name: Update
26-
startWiths: [update, 'up:']
27-
keywords: [update]
35+
start_withs: [update, 'up:']
36+
contains: []

.github/workflows/php.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ jobs:
6161

6262
- name: Generate changelog file
6363
id: changelog
64-
if: ${{ matrix.php == '8.0' }}
64+
if: ${{ matrix.php == '8.1' }}
6565
run: |
66-
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
67-
php kite.phar git cl last head --style gh-release --no-merges --fetch-tags --unshallow --file example/changelog.md
68-
cat example/changelog.md
66+
curl https://github.com/gookit/gitw/releases/latest/download/chlog-linux-amd64 -L -o /usr/local/bin/chlog
67+
chmod a+x /usr/local/bin/chlog
68+
chlog -c .github/changelog.yml -o changelog.md prev last
69+
cat changelog.md
6970
7071
# phpunit -v --debug
7172
# phpdbg -dauto_globals_jit=Off-qrr $(which phpunit) --coverage-clover ./test/clover.info

.github/workflows/release.yml

+5-29
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@ on:
77

88
jobs:
99
release:
10-
name: Test on php ${{ matrix.php}}
10+
name: Tag release
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 10
13-
strategy:
14-
fail-fast: true
15-
matrix:
16-
php: [8.1]
1713

1814
steps:
1915
- name: Checkout
@@ -27,31 +23,11 @@ jobs:
2723
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
2824
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
2925
30-
# usage refer https://github.com/shivammathur/setup-php
31-
- name: Setup PHP
32-
timeout-minutes: 5
33-
uses: shivammathur/setup-php@v2
34-
with:
35-
php-version: ${{ matrix.php}}
36-
tools: pecl, php-cs-fixer, phpunit
37-
extensions: mbstring, fileinfo, openssl # , swoole-4.4.19 #optional, setup extensions
38-
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
39-
coverage: none #optional, setup coverage driver: xdebug, none
40-
41-
- name: Install dependencies # eg: v1.0.3
42-
run: |
43-
echo $RELEASE_TAG
44-
echo $RELEASE_NAME
45-
tag1=${GITHUB_REF#refs/*/}
46-
echo "release tag: ${tag1}"
47-
composer update --no-progress
48-
49-
- name: Generate changelog file
50-
id: changelog
26+
- name: Generate changelog
5127
run: |
52-
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
53-
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --file changelog.md
54-
cat changelog.md
28+
curl https://github.com/gookit/gitw/releases/latest/download/chlog-linux-amd64 -L -o /usr/local/bin/chlog
29+
chmod a+x /usr/local/bin/chlog
30+
chlog -c .github/changelog.yml -o changelog.md prev last
5531
5632
# https://github.com/softprops/action-gh-release
5733
- name: Create release and upload assets

0 commit comments

Comments
 (0)