Skip to content

Commit b9f67a6

Browse files
committed
feat: add release action step for auto generate changelog
1 parent e26c104 commit b9f67a6

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: true
1818
matrix:
19-
php: [7.3, 7.4, 8.0] # 7.2,
19+
php: [7.4, 8.0] # 7.2, 7.3,
2020
os: [ubuntu-latest, macOS-latest] # windows-latest,
2121
# include: # will not testing on php 7.2
2222
# - os: 'ubuntu-latest'

.github/workflows/release.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [7.4]
16+
php: [8.0]
1717

1818
steps:
1919
- name: Checkout
@@ -36,6 +36,9 @@ jobs:
3636
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
3737
coverage: none #optional, setup coverage driver: xdebug, none
3838

39+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
40+
# Docs: https://getcomposer.org/doc/articles/scripts.md
41+
3942
- name: Install dependencies # eg: v1.0.3
4043
run: |
4144
echo $RELEASE_TAG
@@ -44,15 +47,13 @@ jobs:
4447
echo "release tag: ${tag1}"
4548
composer update --no-progress
4649
47-
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
48-
# Docs: https://getcomposer.org/doc/articles/scripts.md
49-
50-
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#steps-context
51-
# - name: Generate changelog file
52-
# id: changelog
53-
# run: |
54-
# php bin/kite gh cl prev $RELEASE_TAG --style gh-release --no-merges --fetch-tags --unshallow --file tmp/changelog-${RELEASE_TAG}.md
55-
# cat tmp/changelog-${RELEASE_TAG}.md
50+
# more see https://github.com/inhere/kite
51+
- name: Generate changelog file
52+
id: changelog
53+
run: |
54+
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
55+
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md
56+
cat changelog.md
5657
5758
# https://github.com/meeDamian/github-release
5859
# - name: Create release and upload assets
@@ -73,7 +74,7 @@ jobs:
7374
with:
7475
name: ${{ env.RELEASE_TAG }}
7576
tag_name: ${{ env.RELEASE_TAG }}
76-
# body_path: tmp/changelog-${{ env.RELEASE_TAG }}.md
77+
body_path: changelog.md
7778
# files: kite-${{ env.RELEASE_TAG }}.phar
7879
env:
7980
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">7.1.0",
14+
"php": ">7.4.0",
1515
"ext-mbstring": "*",
1616
"toolkit/cli-utils":"~1.0"
1717
},
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
"bin": [
29-
29+
3030
],
3131
"scripts": {
3232
"test": "php vender/bin/phpunit"

0 commit comments

Comments
 (0)