diff --git a/.github/changelog.yml b/.github/changelog.yml new file mode 100644 index 0000000..d60b2cb --- /dev/null +++ b/.github/changelog.yml @@ -0,0 +1,37 @@ +title: '## Change Log' +# style allow: simple, markdown(mkdown), ghr(gh-release) +style: gh-release +# group names +names: [Refactor, Fixed, Feature, Update, Other] +# if empty will auto fetch by git remote +#repo_url: https://github.com/gookit/goutil + +filters: + # 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, action test + exclude: true + +# group match rules +# not matched will use 'Other' group. +rules: + - name: Refactor + start_withs: [refactor, break] + contains: ['refactor:'] + - name: Fixed + start_withs: [fix] + contains: ['fix:'] + - name: Feature + start_withs: [feat, new] + contains: [feature, 'feat:'] + - name: Update + start_withs: [up] + contains: ['update:', 'up:'] diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index fca4b79..c3bff25 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: true matrix: - php: [8.0, 8.1] # 7.3, 7.4, + php: [8.1] # 7.3, 7.4, os: [ubuntu-latest, macOS-latest] # windows-latest, # include: # - os: 'ubuntu-latest' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a75cd16..0334f18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,56 +7,38 @@ on: jobs: release: - name: Test on php ${{ matrix.php}} + name: Release new version runs-on: ubuntu-latest timeout-minutes: 10 strategy: fail-fast: true - matrix: - php: [8.0] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + fetch-depth: 0 - - name: Set ENV for github-release + - name: Setup ENV # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable run: | 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, dom, fileinfo, mysql, 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: | - tag1=${GITHUB_REF#refs/*/} - echo "release tag: ${tag1}" - composer install --no-progress - - # more see https://github.com/inhere/kite - - 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 --unshallow --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 uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: name: ${{ env.RELEASE_TAG }} tag_name: ${{ env.RELEASE_TAG }} body_path: changelog.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# GITHUB_REPOSITORY: my_gh_org/my_gh_repo + token: ${{ secrets.GITHUB_TOKEN }} +# files: macos-chlog.exe