|
7 | 7 |
|
8 | 8 | jobs:
|
9 | 9 | release:
|
10 |
| - name: Test on php ${{ matrix.php}} |
| 10 | + name: Release new version |
11 | 11 | runs-on: ubuntu-latest
|
12 | 12 | timeout-minutes: 10
|
13 | 13 | strategy:
|
14 | 14 | fail-fast: true
|
15 |
| - matrix: |
16 |
| - php: [8.0] |
17 | 15 |
|
18 | 16 | steps:
|
19 | 17 | - name: Checkout
|
20 |
| - uses: actions/checkout@v2 |
| 18 | + uses: actions/checkout@v3 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
21 | 21 |
|
22 |
| - - name: Set ENV for github-release |
| 22 | + - name: Setup ENV |
23 | 23 | # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
24 | 24 | run: |
|
25 | 25 | echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
|
26 | 26 | echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
|
27 | 27 |
|
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 |
| 28 | + - name: Generate changelog |
48 | 29 | 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 |
| 30 | + curl https://github.com/gookit/gitw/releases/latest/download/chlog-linux-amd64 -L -o /usr/local/bin/chlog |
| 31 | + chmod a+x /usr/local/bin/chlog |
| 32 | + chlog -c .github/changelog.yml -o changelog.md prev last |
52 | 33 |
|
53 | 34 | # https://github.com/softprops/action-gh-release
|
54 | 35 | - name: Create release and upload assets
|
55 | 36 | uses: softprops/action-gh-release@v1
|
| 37 | + env: |
| 38 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
56 | 39 | with:
|
57 | 40 | name: ${{ env.RELEASE_TAG }}
|
58 | 41 | tag_name: ${{ env.RELEASE_TAG }}
|
59 | 42 | body_path: changelog.md
|
60 |
| - env: |
61 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
62 |
| -# GITHUB_REPOSITORY: my_gh_org/my_gh_repo |
| 43 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | +# files: macos-chlog.exe |
0 commit comments