Skip to content

Commit

Permalink
up: use the gookit/gitw chlog for generate changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jul 19, 2022
1 parent 2772c34 commit 6628805
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 53 deletions.
49 changes: 29 additions & 20 deletions .github/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
options:
title: '## Change Log'
style: gh-release
title: '## Change Log'
# style allow: simple, markdown(mkdown), ghr(gh-release)
style: gh-release
# group names
names: [Refactor, Fixed, Feature, Update, Other]
#repo_url: https://github.com/gookit/gcli

filters:
# message length >= 12
- name: msgLen
minLen: 12
# message words >= 3
- name: wordsLen
minLen: 3
# message length should >= 12
- name: msg_len
min_len: 12
# message words should >= 3
- name: words_len
min_len: 3
- name: keyword
keyword: format code
exclude: true
- name: keywords
keywords: ['format code']
keywords: format code, action test
exclude: true

# group match rules
# not matched will use 'Other' group.
groups:
- name: New
keywords: [add, new]
rules:
- name: Refactor
start_withs: [refactor, break]
contains: ['refactor:']
- name: Fixed
startWiths: [add, new]
keywords: [add, new]
- name: Feat
startWiths: [feat]
keywords: [feature]
start_withs: [fix]
contains: ['fix:']
- name: Feature
start_withs: [feat, new]
contains: [feature]
- name: Update
startWiths: [update, 'up:']
keywords: [update]
start_withs: [update, 'up:']
contains: []
9 changes: 5 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ jobs:

- name: Generate changelog file
id: changelog
if: ${{ matrix.php == '8.0' }}
if: ${{ matrix.php == '8.1' }}
run: |
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
php kite.phar git cl last head --style gh-release --no-merges --fetch-tags --unshallow --file example/changelog.md
cat example/changelog.md
curl https://github.com/gookit/gitw/releases/latest/download/chlog-linux-amd64 -L -o /usr/local/bin/chlog
chmod a+x /usr/local/bin/chlog
chlog -c .github/changelog.yml -o changelog.md prev last
cat changelog.md
# phpunit -v --debug
# phpdbg -dauto_globals_jit=Off-qrr $(which phpunit) --coverage-clover ./test/clover.info
Expand Down
34 changes: 5 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ on:

jobs:
release:
name: Test on php ${{ matrix.php}}
name: Tag release
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
php: [8.1]

steps:
- name: Checkout
Expand All @@ -27,31 +23,11 @@ jobs:
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
# usage refer https://github.com/shivammathur/setup-php
- name: Setup PHP
timeout-minutes: 5
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
tools: pecl, php-cs-fixer, phpunit
extensions: mbstring, fileinfo, openssl # , swoole-4.4.19 #optional, setup extensions
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
coverage: none #optional, setup coverage driver: xdebug, none

- name: Install dependencies # eg: v1.0.3
run: |
echo $RELEASE_TAG
echo $RELEASE_NAME
tag1=${GITHUB_REF#refs/*/}
echo "release tag: ${tag1}"
composer update --no-progress
- name: Generate changelog file
id: changelog
- name: Generate changelog
run: |
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --file changelog.md
cat changelog.md
curl https://github.com/gookit/gitw/releases/latest/download/chlog-linux-amd64 -L -o /usr/local/bin/chlog
chmod a+x /usr/local/bin/chlog
chlog -c .github/changelog.yml -o changelog.md prev last
# https://github.com/softprops/action-gh-release
- name: Create release and upload assets
Expand Down

0 comments on commit 6628805

Please sign in to comment.