Skip to content

Commit c791e81

Browse files
committed
up: update the gh release script
1 parent e5fc286 commit c791e81

File tree

2 files changed

+44
-30
lines changed

2 files changed

+44
-30
lines changed

.github/changelog.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
8+
filters:
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
18+
- name: keywords
19+
keywords: format code, action test
20+
exclude: true
21+
22+
# group match rules
23+
# not matched will use 'Other' group.
24+
rules:
25+
- name: Refactor
26+
start_withs: [refactor, break]
27+
contains: ['refactor:', 'break:']
28+
- name: Fixed
29+
start_withs: [fix]
30+
contains: ['fix:']
31+
- name: Feature
32+
start_withs: [feat, new]
33+
contains: ['feat:', 'new:']
34+
- name: Update
35+
start_withs: [up]
36+
contains: ['update:', 'up:']

.github/workflows/release.yml

+8-30
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,27 @@ 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.0]
1713

1814
steps:
1915
- name: Checkout
2016
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
2119

2220
- name: Set ENV for github-release
2321
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
2422
run: |
2523
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
2624
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
2725
28-
# usage refer https://github.com/shivammathur/setup-php
29-
- name: Setup PHP
30-
timeout-minutes: 5
31-
uses: shivammathur/setup-php@v2
32-
with:
33-
php-version: ${{ matrix.php}}
34-
tools: pecl, php-cs-fixer, phpunit
35-
extensions: mbstring, dom, fileinfo, mysql, openssl # , swoole-4.4.19 #optional, setup extensions
36-
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
37-
coverage: none #optional, setup coverage driver: xdebug, none
38-
39-
- name: Install dependencies # eg: v1.0.3
40-
run: |
41-
tag1=${GITHUB_REF#refs/*/}
42-
echo "release tag: ${tag1}"
43-
composer install --no-progress
44-
45-
# more see https://github.com/inhere/kite
46-
- name: Generate changelog file
47-
id: changelog
26+
- name: Generate changelog
4827
run: |
49-
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
50-
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md
51-
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
5231
5332
# https://github.com/softprops/action-gh-release
5433
- name: Create release and upload assets
@@ -58,5 +37,4 @@ jobs:
5837
tag_name: ${{ env.RELEASE_TAG }}
5938
body_path: changelog.md
6039
env:
61-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62-
# GITHUB_REPOSITORY: my_gh_org/my_gh_repo
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)