forked from Light-Heart-Labs/DreamServer
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (101 loc) · 4.09 KB
/
release-notes.yml
File metadata and controls
124 lines (101 loc) · 4.09 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: AI Release Notes
# Generate AI-powered release notes on new releases
# Analyzes commits since last release and generates structured notes
# Estimated cost: ~$1.50/release
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: "Release tag to generate notes for (e.g. v1.2.0)"
required: true
type: string
concurrency:
group: release-notes
cancel-in-progress: false
jobs:
generate:
name: Generate Release Notes
runs-on: ubuntu-latest
permissions:
contents: write
env:
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Validate required secrets
env:
HAS_API_KEY: ${{ secrets.ANTHROPIC_API_KEY != '' }}
run: |
if [ "$HAS_API_KEY" != "true" ]; then
echo "::error::ANTHROPIC_API_KEY not configured"
exit 1
fi
echo "Required secrets present"
- name: Validate release tag format
run: |
if ! echo "$RELEASE_TAG" | grep -qE '^v?[0-9]+\.[0-9]+'; then
echo "::error::Invalid release tag format: $RELEASE_TAG (expected vX.Y.Z or X.Y.Z)"
exit 1
fi
- name: Get previous release tag
id: prev_tag
run: |
PREV_TAG=$(git tag --sort=-v:refname | grep -Fxv "$RELEASE_TAG" | head -1)
if [ -z "$PREV_TAG" ]; then
PREV_TAG=$(git rev-list --max-parents=0 HEAD | head -1)
echo "No previous tag found, using initial commit: $PREV_TAG"
fi
echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
echo "Previous release: $PREV_TAG"
- name: Generate Release Notes
uses: anthropics/claude-code-action@905d4eb99ab3d43143d74fb0dcae537f29ac330a # v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
Generate release notes for DreamServer release ${{ env.RELEASE_TAG }}.
## Instructions
1. Get the commit log since the previous release:
`git log ${{ steps.prev_tag.outputs.prev_tag }}..${{ env.RELEASE_TAG }} --oneline --no-merges`
2. Also check the full diff for a high-level understanding:
`git diff --stat ${{ steps.prev_tag.outputs.prev_tag }}..${{ env.RELEASE_TAG }}`
3. Categorize changes into these sections:
- **New Features**: New functionality added
- **Improvements**: Enhancements to existing features
- **Bug Fixes**: Issues resolved
- **Security**: Security-related changes
- **CI/CD**: Pipeline and automation changes
- **Documentation**: Doc updates
- **Dependencies**: Dependency updates
- **Breaking Changes**: Changes that may affect existing users
4. Update the release body using:
```
gh release edit ${{ env.RELEASE_TAG }} --notes "$(cat <<'NOTES'
<your generated notes here>
NOTES
)"
```
## Format
Use this format for the release notes:
```markdown
## What's Changed
### New Features
- Feature description (#PR_NUMBER)
### Improvements
- Improvement description (#PR_NUMBER)
### Bug Fixes
- Fix description (#PR_NUMBER)
[... other sections as applicable ...]
### Contributors
- @username
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.prev_tag.outputs.prev_tag }}...${{ env.RELEASE_TAG }}
```
Only include sections that have actual changes. Skip empty sections.
claude_args: >-
--allowedTools
"Bash(git log *),Bash(git diff *),Bash(gh release edit *),Bash(gh pr list *),Read,Glob,Grep"
--max-turns 10