-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (37 loc) · 1.05 KB
/
Copy pathrelease.yml
File metadata and controls
42 lines (37 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Create Release
on:
push:
tags:
- 'v*'
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Release Notes
id: release_notes
run: |
# Extract last entry from CHANGELOG.md or use git log
if [ -d docs/CHANGELOG.md ]; then
# Extract content between the first two ## headers
sed -n '/^## \[[v0-9.]*\]/,/^## \[[v0-9.]*\]/p' docs/CHANGELOG.md | sed '$d' > release_notes.md
fi
if [ ! -s release_notes.md ]; then
git log --oneline -n 10 > release_notes.md
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.md
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}