From cace9e2a2ceacb07073b26ac627cdc4e1b051518 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Wed, 12 Jul 2023 11:39:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95release=20Actions?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90changelog=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.yml | 33 ------------------------------- .github/workflows/go-release.yml | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 33 deletions(-) delete mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index 1797854..0000000 --- a/.github/release.yml +++ /dev/null @@ -1,33 +0,0 @@ -changelog: - sort: asc - use: github - filters: - exclude: - - "^test:" - - "^chore" - - "merge conflict" - - Merge pull request - - Merge remote-tracking branch - - Merge branch - - go mod tidy - categories: - - title: "👒Dependency updates" - regexp: '^.*?(feat|fix)\(deps\)!?:.+$' - order: 300 - - title: "🏕New Features" - regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' - order: 100 - - title: "Security updates" - regexp: '^.*?sec(\([[:word:]]+\))??!?:.+$' - order: 150 - - title: "Bug fixes" - regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' - order: 200 - - title: "Documentation updates" - regexp: '^.*?doc(\([[:word:]]+\))??!?:.+$' - order: 400 - - title: "Build process updates" - regexp: '^.*?build(\([[:word:]]+\))??!?:.+$' - order: 400 - - title: Other work - order: 9999 \ No newline at end of file diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index d043c73..06fc4a4 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -5,6 +5,40 @@ on: types: [created] # 表示在创建新的 Release 时触发 jobs: + changelog: + name: Generate changelog + runs-on: ubuntu-latest + outputs: + release_body: ${{ steps.git-cliff.outputs.content }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Generate a changelog + uses: orhun/git-cliff-action@v2 + id: git-cliff + with: + config: cliff.toml + args: -vv --latest --strip header + env: + OUTPUT: CHANGES.md + # use release body in the same job + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + body: ${{ steps.git-cliff.outputs.content }} + # note you'll typically need to create a personal access token + # with permissions to create releases in the other repo + token: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_REPOSITORY: ${{ github.repository }} + + + build-go-binary: runs-on: ubuntu-latest strategy: