@@ -27,35 +27,63 @@ jobs:
2727 - name : Check if release already exists
2828 id : check_release
2929 run : |
30- chmod +x .github/workflows/scripts/check-release-exists.sh
31- .github/workflows/scripts/check-release-exists.sh ${{ steps.version.outputs.tag }}
30+ VERSION="${{ steps.version.outputs.tag }}"
31+ if gh release view "$VERSION" >/dev/null 2>&1; then
32+ echo "exists=true" >> $GITHUB_OUTPUT
33+ echo "Release $VERSION already exists, skipping..."
34+ else
35+ echo "exists=false" >> $GITHUB_OUTPUT
36+ echo "Release $VERSION does not exist, proceeding..."
37+ fi
3238 env :
3339 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3440
35- - name : Create release package variants
36- if : steps.check_release.outputs.exists == 'false'
37- run : |
38- chmod +x .github/workflows/scripts/create-release-packages.sh
39- .github/workflows/scripts/create-release-packages.sh ${{ steps.version.outputs.tag }}
40-
4141 - name : Generate release notes
4242 if : steps.check_release.outputs.exists == 'false'
43- id : release_notes
4443 run : |
45- chmod +x .github/workflows/scripts/generate-release-notes.sh
46- # Get the previous tag for changelog generation
47- PREVIOUS_TAG=$(git describe --tags --abbrev=0 ${{ steps.version.outputs.tag }}^ 2>/dev/null || echo "")
48- # Default to v0.0.0 if no previous tag is found (e.g., first release)
44+ VERSION="${{ steps.version.outputs.tag }}"
45+ VERSION_NO_V=${VERSION#v}
46+
47+ # Find previous tag
48+ PREVIOUS_TAG=$(git tag -l 'v*' --sort=-version:refname | grep -v "^${VERSION}$" | head -n 1)
49+ if [ -z "$PREVIOUS_TAG" ]; then
50+ PREVIOUS_TAG=""
51+ fi
52+
53+ # Get commits since previous tag
4954 if [ -z "$PREVIOUS_TAG" ]; then
50- PREVIOUS_TAG="v0.0.0"
55+ COMMIT_COUNT=$(git rev-list --count HEAD)
56+ if [ "$COMMIT_COUNT" -gt 20 ]; then
57+ COMMITS=$(git log --oneline --pretty=format:"- %s" --no-merges HEAD~20..HEAD)
58+ else
59+ COMMITS=$(git log --oneline --pretty=format:"- %s" --no-merges)
60+ fi
61+ else
62+ COMMITS=$(git log --oneline --pretty=format:"- %s" --no-merges "$PREVIOUS_TAG"..HEAD)
5163 fi
52- .github/workflows/scripts/generate-release-notes.sh ${{ steps.version.outputs.tag }} "$PREVIOUS_TAG"
64+
65+ cat > release_notes.md << NOTES_EOF
66+ ## Install
67+
68+ \`\`\`bash
69+ uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@${VERSION}
70+ specify init my-project
71+ \`\`\`
72+
73+ NOTES_EOF
74+
75+ echo "## What's Changed" >> release_notes.md
76+ echo "" >> release_notes.md
77+ echo "$COMMITS" >> release_notes.md
5378
5479 - name : Create GitHub Release
5580 if : steps.check_release.outputs.exists == 'false'
5681 run : |
57- chmod +x .github/workflows/scripts/create-github-release.sh
58- .github/workflows/scripts/create-github-release.sh ${{ steps.version.outputs.tag }}
82+ VERSION="${{ steps.version.outputs.tag }}"
83+ VERSION_NO_V=${VERSION#v}
84+ gh release create "$VERSION" \
85+ --title "Spec Kit - $VERSION_NO_V" \
86+ --notes-file release_notes.md
5987 env :
6088 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6189
0 commit comments