-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 1.87 KB
/
release.yaml
File metadata and controls
78 lines (65 loc) · 1.87 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
validate:
uses: ./.github/workflows/ci.yaml
release:
needs: validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Generate changelog
id: changelog
run: |
# Find the previous tag
prev_tag=$(git tag --sort=-v:refname | sed -n '2p')
if [ -z "$prev_tag" ]; then
# First release — log from the beginning
log=$(git log --pretty=format:"- %s (%h)" "$GITHUB_REF")
else
log=$(git log --pretty=format:"- %s (%h)" "${prev_tag}..${GITHUB_REF}")
fi
# Write to file for body_path
echo "$log" > RELEASE_NOTES.md
- name: Create release archive
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
archive="pharaoh-${VERSION}.zip"
# Collect paths that exist
paths=""
for p in \
skills/ \
.github/agents/ \
.github/prompts/ \
.claude-plugin/ \
agents/ \
tests/fixtures/ \
pharaoh.toml.example \
README.md \
LICENSE \
CHANGELOG.md \
CONTRIBUTING.md \
SECURITY.md
do
[ -e "$p" ] && paths="$paths $p"
done
zip -r "$archive" $paths
echo "archive=${archive}" >> "$GITHUB_ENV"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.version.outputs.version }}
body_path: RELEASE_NOTES.md
files: ${{ env.archive }}