Skip to content

Commit b6d52e9

Browse files
committed
Add changelog to release body
1 parent efd194d commit b6d52e9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/build_and_publish.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: ${{ matrix.platform }}
2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0 # Fetch all history for all tags and branches
2224

2325
- name: Rust Cache
2426
uses: Swatinem/rust-cache@v2
@@ -79,6 +81,23 @@ jobs:
7981
VERSION=$(node -p "require('./package.json').version")
8082
echo "VERSION=$VERSION" >> $GITHUB_ENV
8183
84+
- name: Get last release
85+
id: last_release
86+
run: |
87+
last_release=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
88+
"https://api.github.com/repos/${{ github.repository }}/releases/latest" | \
89+
jq -r .tag_name)
90+
echo "Last release tag: $last_release"
91+
echo "last_release=$last_release" >> $GITHUB_OUTPUT
92+
93+
- name: Create Changelog
94+
id: create_changelog
95+
run: |
96+
git log ${{ steps.last_release.outputs.last_release }}..HEAD --pretty=format:"- %s %h%n" > changelog.md
97+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
98+
echo "$(cat changelog.md)" >> $GITHUB_OUTPUT
99+
echo "EOF" >> $GITHUB_OUTPUT
100+
82101
- name: build and publish
83102
uses: tauri-apps/tauri-action@v0
84103
env:
@@ -102,7 +121,10 @@ jobs:
102121
with:
103122
tagName: v__VERSION__
104123
releaseName: "v__VERSION__"
105-
releaseBody: "See the assets to download this version and install."
124+
releaseBody: |
125+
Changes in this Release:
126+
127+
${{ steps.create_changelog.outputs.changelog }}
106128
args: ${{ matrix.args }}
107129
includeUpdaterJson: true
108130
includeDebug: true

0 commit comments

Comments
 (0)