Skip to content

Commit 74a1007

Browse files
committed
up: update release gh action. fix some code style
1 parent ab908dc commit 74a1007

File tree

5 files changed

+9
-29
lines changed

5 files changed

+9
-29
lines changed

Diff for: .github/workflows/release.yml

+5-25
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ on:
77

88
jobs:
99
release:
10-
name: Test on php ${{ matrix.php}}
10+
name: Release new version
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 10
1313
strategy:
1414
fail-fast: true
15-
matrix:
16-
php: [8.2]
1715

1816
steps:
1917
- name: Checkout
@@ -25,29 +23,11 @@ jobs:
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
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-
- name: Generate changelog file
46-
id: changelog
26+
- name: Generate changelog
4727
run: |
48-
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
49-
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md
50-
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
5131
5232
# https://github.com/softprops/action-gh-release
5333
- name: Create release and upload assets

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![License](https://img.shields.io/packagist/l/toolkit/cli-utils.svg?style=flat-square)](LICENSE)
44
[![Php Version](https://img.shields.io/badge/php-%3E=8.0.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/toolkit/cli-utils)
55
[![Latest Stable Version](http://img.shields.io/packagist/v/toolkit/cli-utils.svg)](https://packagist.org/packages/toolkit/cli-utils)
6-
[![Github Actions Status](https://github.com/php-toolkit/cli-utils/workflows/Unit-tests/badge.svg)](https://github.com/php-toolkit/cli-utils/actions)
6+
[![Actions Status](https://github.com/php-toolkit/cli-utils/workflows/Unit-tests/badge.svg)](https://github.com/php-toolkit/cli-utils/actions)
77

88
Provide some useful utils for the php CLI application.
99

Diff for: example/readline/cb_handler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @return string
1717
* @link https://www.php.net/manual/zh/function.readline-callback-handler-install.php#123075
1818
*/
19-
function handler_read_demo(int $count, string $prompt = null): string
19+
function handler_read_demo(int $count, ?string $prompt = null): string
2020
{
2121
$prev = '';
2222

Diff for: src/CliApp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function addArg(string $name, string $desc, mixed $default = null, array
215215
*
216216
* @return int
217217
*/
218-
public function run(array $flags = null): int
218+
public function run(?array $flags = null): int
219219
{
220220
if ($flags === null) {
221221
$flags = $_SERVER['argv'];

Diff for: src/Util/Terminal.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function isEchoBack(): bool
294294
*
295295
* @return $this
296296
*/
297-
public function cursor(string $typeName, int $arg1 = 1, int $arg2 = null): self
297+
public function cursor(string $typeName, int $arg1 = 1, ?int $arg2 = null): self
298298
{
299299
if (!isset(self::CURSOR_CONTROL_CODES[$typeName])) {
300300
Cli::stderr("The [$typeName] is not supported cursor control.");

0 commit comments

Comments
 (0)