Skip to content

Commit

Permalink
Automate changelog generation in release process
Browse files Browse the repository at this point in the history
- Implement a new workflow job for generating a release changelog with git-cliff.
- Refactor release body handling to utilize output from the changelog generation job.
- Remove outdated changelog generation step from the publish-tauri job.
  • Loading branch information
zhongweili committed Dec 7, 2024
1 parent a9fcd2d commit bfc36f2
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,27 @@ concurrency:
cancel-in-progress: true

jobs:
create-release:
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.git-cliff.outputs.content }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@v2
id: git-cliff
if: startsWith(github.ref, 'refs/tags/')
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md

publish-tauri:
needs: create-release
permissions:
contents: write
strategy:
Expand Down Expand Up @@ -50,23 +70,13 @@ jobs:
- name: install frontend dependencies
run: yarn install

- name: Generate a changelog
uses: orhun/git-cliff-action@v2
id: git-cliff
if: startsWith(github.ref, 'refs/tags/')
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: app-v__VERSION__
releaseName: 'App v__VERSION__'
releaseBody: ${{ steps.git-cliff.outputs.content }}
releaseBody: ${{ needs.create-release.outputs.changelog }}
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}

0 comments on commit bfc36f2

Please sign in to comment.