77
88jobs :
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 : [7.3]
1713
1814 steps :
1915 - name : Checkout
2016 uses : actions/checkout@v4
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
26+ - name : Generate changelog
4027 run : |
41- tag1=${GITHUB_REF#refs/*/}
42- echo "release tag: ${tag1}"
43- composer install --no-progress --no-suggest
44-
45- # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
46- # Docs: https://getcomposer.org/doc/articles/scripts.md
47-
48- # - name: Build phar and send to github assets
49- # run: |
50- # echo $RELEASE_TAG
51- # echo $RELEASE_NAME
52- # php -d phar.readonly=0 bin/kite phar:pack -o kite-${RELEASE_TAG}.phar --no-progress
53- # php kite-${RELEASE_TAG}.phar -V
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
5431
55- # https://github.com/actions/create-release
56- - uses : meeDamian/github-release@2.0
32+ # https://github.com/softprops/action-gh-release
33+ - name : Create release and upload assets
34+ uses : softprops/action-gh-release@v2
5735 with :
58- gzip : false
59- token : ${{ secrets.GITHUB_TOKEN }}
60- tag : ${{ env.RELEASE_TAG }}
6136 name : ${{ env.RELEASE_TAG }}
62- # files: kite-${{ env.RELEASE_TAG }}.phar
37+ tag_name : ${{ env.RELEASE_TAG }}
38+ body_path : changelog.md
39+ env :
40+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments