Skip to content

Commit

Permalink
feat: 测试release Actions自动生成changelog功能
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Jul 12, 2023
1 parent 0e5a812 commit cace9e2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 33 deletions.
33 changes: 0 additions & 33 deletions .github/release.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cace9e2

Please sign in to comment.