Skip to content

Commit e2d1da5

Browse files
committed
Update release workflow
1 parent 252eedf commit e2d1da5

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release workflow
1+
name: Create Release
22

33
on:
44
push:
@@ -7,23 +7,29 @@ on:
77
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
88

99
jobs:
10-
# Create the release from the tag
1110
create-release:
12-
name: Create Release
11+
name: Create GitHub Release
1312
runs-on: ubuntu-latest
13+
14+
# Explicitly grant permission to create/write releases
15+
permissions:
16+
contents: write
17+
1418
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v2
17-
- name: Create Release
18-
id: create_release
19-
uses: actions/create-release@v1
20-
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
# Step 1: Check out the repository code
20+
# Fetch the full history to compare between tags
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
# Generate the release
27+
- name: Generate and Publish Release
28+
uses: softprops/action-gh-release@v2
2229
with:
23-
tag_name: ${{ github.ref }}
24-
release_name: Release ${{ github.ref }}
25-
body: |
26-
See the [CHANGELOG](CHANGELOG.md)
30+
tag_name: ${{ github.ref_name }}
31+
name: Release ${{ github.ref_name }}
32+
generate_release_notes: true
2733
draft: false
2834
prerelease: false
2935

0 commit comments

Comments
 (0)