Skip to content

Commit 47021d5

Browse files
committed
feat: update release workflow to use softprops/action-gh-release for draft creation with auto-generated changelog
1 parent 89c1199 commit 47021d5

File tree

1 file changed

+16
-36
lines changed

1 file changed

+16
-36
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,28 @@ jobs:
1414
contents: write
1515
runs-on: ubuntu-latest
1616
outputs:
17-
release_id: ${{ steps.create.outputs.result }}
17+
release_id: ${{ steps.create.outputs.id }}
1818
steps:
1919
- uses: actions/checkout@v4
2020

2121
- name: Create draft release with auto changelog
2222
id: create
23-
uses: actions/github-script@v7
23+
uses: softprops/action-gh-release@v2
2424
with:
25-
script: |
26-
const tagName = context.ref.replace('refs/tags/', '') || 'v4.0';
27-
28-
// Use GitHub's built-in release notes generator
29-
let generatedNotes = '';
30-
try {
31-
const { data: notes } = await github.rest.repos.generateReleaseNotes({
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
34-
tag_name: tagName,
35-
});
36-
generatedNotes = notes.body;
37-
} catch (e) {
38-
console.log('Auto-generate notes failed, using fallback:', e.message);
39-
generatedNotes = '';
40-
}
41-
42-
const downloads = `\n---\n\n**Downloads**\n\n| Platform | File | Architecture |\n|----------|------|--------------|\n| macOS | \`.dmg\` | Universal (Intel + Apple Silicon) |\n| Windows | \`.msi\` / \`.exe\` | x86_64 |\n| Linux | \`.deb\` / \`.AppImage\` | x86_64 |\n| Linux CLI | \`.tar.gz\` | amd64 / aarch64 |`;
43-
44-
const body = generatedNotes
45-
? `${generatedNotes}${downloads}`
46-
: `See the assets below to download the app for your platform.${downloads}`;
47-
48-
const { data } = await github.rest.repos.createRelease({
49-
owner: context.repo.owner,
50-
repo: context.repo.repo,
51-
tag_name: tagName,
52-
name: `Fetch Github Hosts ${tagName}`,
53-
body: body,
54-
draft: true,
55-
prerelease: false
56-
});
57-
return data.id;
58-
result-encoding: string
25+
draft: true
26+
generate_release_notes: true
27+
append_body: true
28+
body: |
29+
---
30+
31+
**Downloads**
32+
33+
| Platform | File | Architecture |
34+
|----------|------|--------------|
35+
| macOS | `.dmg` | Universal (Intel + Apple Silicon) |
36+
| Windows | `.msi` / `.exe` | x86_64 |
37+
| Linux | `.deb` / `.AppImage` | x86_64 |
38+
| Linux CLI | `.tar.gz` | amd64 / aarch64 |
5939
6040
build-tauri:
6141
needs: create-release

0 commit comments

Comments
 (0)