-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (48 loc) · 1.48 KB
/
release.yml
File metadata and controls
60 lines (48 loc) · 1.48 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
- name: Build
run: uv build
- name: Generate release notes
id: release_notes
run: |
# Get the previous tag
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
# Get commit messages since last release
if [ -z "$PREVIOUS_TAG" ]; then
# If no previous tag, get all commits
COMMITS=$(git log --pretty=format:"- %s (%h)" --reverse)
else
# Get commits since the last tag
COMMITS=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s (%h)" --reverse)
fi
# Create release notes
cat << EOF > release_notes.md
## What's Changed
$COMMITS
**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREVIOUS_TAG...${{ github.ref_name }}
EOF
# Output for GitHub Actions
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.md
files: dist/*
generate_release_notes: false