@@ -25,33 +25,13 @@ jobs:
2525 - name : Get latest tag
2626 id : get_tag
2727 run : |
28- # Get the latest tag, or use v0.0.0 if no tags exist
29- LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
30- echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT
31-
32- # Extract version number and increment
33- VERSION=$(echo $LATEST_TAG | sed 's/v//')
34- IFS='.' read -ra VERSION_PARTS <<< "$VERSION"
35- MAJOR=${VERSION_PARTS[0]:-0}
36- MINOR=${VERSION_PARTS[1]:-0}
37- PATCH=${VERSION_PARTS[2]:-0}
38-
39- # Increment patch version
40- PATCH=$((PATCH + 1))
41- NEW_VERSION="v$MAJOR.$MINOR.$PATCH"
42-
43- echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
44- echo "New version will be: $NEW_VERSION"
28+ chmod +x .github/workflows/scripts/get-next-version.sh
29+ .github/workflows/scripts/get-next-version.sh
4530 - name : Check if release already exists
4631 id : check_release
4732 run : |
48- if gh release view ${{ steps.get_tag.outputs.new_version }} >/dev/null 2>&1; then
49- echo "exists=true" >> $GITHUB_OUTPUT
50- echo "Release ${{ steps.get_tag.outputs.new_version }} already exists, skipping..."
51- else
52- echo "exists=false" >> $GITHUB_OUTPUT
53- echo "Release ${{ steps.get_tag.outputs.new_version }} does not exist, proceeding..."
54- fi
33+ chmod +x .github/workflows/scripts/check-release-exists.sh
34+ .github/workflows/scripts/check-release-exists.sh ${{ steps.get_tag.outputs.new_version }}
5535 env :
5636 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5737 - name : Create release package variants
@@ -63,85 +43,17 @@ jobs:
6343 if : steps.check_release.outputs.exists == 'false'
6444 id : release_notes
6545 run : |
66- # Get commits since last tag
67- LAST_TAG=${{ steps.get_tag.outputs.latest_tag }}
68- if [ "$LAST_TAG" = "v0.0.0" ]; then
69- # Check how many commits we have and use that as the limit
70- COMMIT_COUNT=$(git rev-list --count HEAD)
71- if [ "$COMMIT_COUNT" -gt 10 ]; then
72- COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~10..HEAD)
73- else
74- COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~$COMMIT_COUNT..HEAD 2>/dev/null || git log --oneline --pretty=format:"- %s")
75- fi
76- else
77- COMMITS=$(git log --oneline --pretty=format:"- %s" $LAST_TAG..HEAD)
78- fi
79-
80- # Create release notes
81- cat > release_notes.md << EOF
82- Template release ${{ steps.get_tag.outputs.new_version }}
83-
84- Updated specification-driven development templates for GitHub Copilot, Claude Code, Gemini CLI, Cursor, Qwen, opencode, Windsurf, and Codex.
85-
86- Now includes per-script variants for POSIX shell (sh) and PowerShell (ps).
87-
88- Download the template for your preferred AI assistant + script type:
89- - spec-kit-template-copilot-sh-${{ steps.get_tag.outputs.new_version }}.zip
90- - spec-kit-template-copilot-ps-${{ steps.get_tag.outputs.new_version }}.zip
91- - spec-kit-template-claude-sh-${{ steps.get_tag.outputs.new_version }}.zip
92- - spec-kit-template-claude-ps-${{ steps.get_tag.outputs.new_version }}.zip
93- - spec-kit-template-gemini-sh-${{ steps.get_tag.outputs.new_version }}.zip
94- - spec-kit-template-gemini-ps-${{ steps.get_tag.outputs.new_version }}.zip
95- - spec-kit-template-cursor-sh-${{ steps.get_tag.outputs.new_version }}.zip
96- - spec-kit-template-cursor-ps-${{ steps.get_tag.outputs.new_version }}.zip
97- - spec-kit-template-opencode-sh-${{ steps.get_tag.outputs.new_version }}.zip
98- - spec-kit-template-opencode-ps-${{ steps.get_tag.outputs.new_version }}.zip
99- - spec-kit-template-qwen-sh-${{ steps.get_tag.outputs.new_version }}.zip
100- - spec-kit-template-qwen-ps-${{ steps.get_tag.outputs.new_version }}.zip
101- - spec-kit-template-windsurf-sh-${{ steps.get_tag.outputs.new_version }}.zip
102- - spec-kit-template-windsurf-ps-${{ steps.get_tag.outputs.new_version }}.zip
103- - spec-kit-template-codex-sh-${{ steps.get_tag.outputs.new_version }}.zip
104- - spec-kit-template-codex-ps-${{ steps.get_tag.outputs.new_version }}.zip
105- EOF
106-
107- echo "Generated release notes:"
108- cat release_notes.md
46+ chmod +x .github/workflows/scripts/generate-release-notes.sh
47+ .github/workflows/scripts/generate-release-notes.sh ${{ steps.get_tag.outputs.new_version }} ${{ steps.get_tag.outputs.latest_tag }}
10948 - name : Create GitHub Release
11049 if : steps.check_release.outputs.exists == 'false'
11150 run : |
112- # Remove 'v' prefix from version for release title
113- VERSION_NO_V=${{ steps.get_tag.outputs.new_version }}
114- VERSION_NO_V=${VERSION_NO_V#v}
115-
116- gh release create ${{ steps.get_tag.outputs.new_version }} \
117- spec-kit-template-copilot-sh-${{ steps.get_tag.outputs.new_version }}.zip \
118- spec-kit-template-copilot-ps-${{ steps.get_tag.outputs.new_version }}.zip \
119- spec-kit-template-claude-sh-${{ steps.get_tag.outputs.new_version }}.zip \
120- spec-kit-template-claude-ps-${{ steps.get_tag.outputs.new_version }}.zip \
121- spec-kit-template-gemini-sh-${{ steps.get_tag.outputs.new_version }}.zip \
122- spec-kit-template-gemini-ps-${{ steps.get_tag.outputs.new_version }}.zip \
123- spec-kit-template-cursor-sh-${{ steps.get_tag.outputs.new_version }}.zip \
124- spec-kit-template-cursor-ps-${{ steps.get_tag.outputs.new_version }}.zip \
125- spec-kit-template-opencode-sh-${{ steps.get_tag.outputs.new_version }}.zip \
126- spec-kit-template-opencode-ps-${{ steps.get_tag.outputs.new_version }}.zip \
127- spec-kit-template-qwen-sh-${{ steps.get_tag.outputs.new_version }}.zip \
128- spec-kit-template-qwen-ps-${{ steps.get_tag.outputs.new_version }}.zip \
129- spec-kit-template-windsurf-sh-${{ steps.get_tag.outputs.new_version }}.zip \
130- spec-kit-template-windsurf-ps-${{ steps.get_tag.outputs.new_version }}.zip \
131- spec-kit-template-codex-sh-${{ steps.get_tag.outputs.new_version }}.zip \
132- spec-kit-template-codex-ps-${{ steps.get_tag.outputs.new_version }}.zip \
133- --title "Spec Kit Templates - $VERSION_NO_V" \
134- --notes-file release_notes.md
51+ chmod +x .github/workflows/scripts/create-github-release.sh
52+ .github/workflows/scripts/create-github-release.sh ${{ steps.get_tag.outputs.new_version }}
13553 env :
13654 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13755 - name : Update version in pyproject.toml (for release artifacts only)
13856 if : steps.check_release.outputs.exists == 'false'
13957 run : |
140- # Update version in pyproject.toml (remove 'v' prefix for Python versioning)
141- VERSION=${{ steps.get_tag.outputs.new_version }}
142- PYTHON_VERSION=${VERSION#v}
143-
144- if [ -f "pyproject.toml" ]; then
145- sed -i "s/version = \".*\"/version = \"$PYTHON_VERSION\"/" pyproject.toml
146- echo "Updated pyproject.toml version to $PYTHON_VERSION (for release artifacts only)"
147- fi
58+ chmod +x .github/workflows/scripts/update-version.sh
59+ .github/workflows/scripts/update-version.sh ${{ steps.get_tag.outputs.new_version }}
0 commit comments