💫 Toolkit to help you get started with SDD or any other process!
Update script delegation from GitHub Action
Den Delimarsky 🌺e83e1cd8e34b
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex b31bbaa69..0bede837f 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -25,33 +25,13 @@ jobs:- name: Get latest tagid: get_tagrun: |- # Get the latest tag, or use v0.0.0 if no tags exist- LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")- echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT-- # Extract version number and increment- VERSION=$(echo $LATEST_TAG | sed 's/v//')- IFS='.' read -ra VERSION_PARTS <<< "$VERSION"- MAJOR=${VERSION_PARTS[0]:-0}- MINOR=${VERSION_PARTS[1]:-0}- PATCH=${VERSION_PARTS[2]:-0}-- # Increment patch version- PATCH=$((PATCH + 1))- NEW_VERSION="v$MAJOR.$MINOR.$PATCH"-- echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT- echo "New version will be: $NEW_VERSION"+ chmod +x .github/workflows/scripts/get-next-version.sh+ .github/workflows/scripts/get-next-version.sh- name: Check if release already existsid: check_releaserun: |- if gh release view ${{ steps.get_tag.outputs.new_version }} >/dev/null 2>&1; then- echo "exists=true" >> $GITHUB_OUTPUT- echo "Release ${{ steps.get_tag.outputs.new_version }} already exists, skipping..."- else- echo "exists=false" >> $GITHUB_OUTPUT- echo "Release ${{ steps.get_tag.outputs.new_version }} does not exist, proceeding..."- fi+ chmod +x .github/workflows/scripts/check-release-exists.sh+ .github/workflows/scripts/check-release-exists.sh ${{ steps.get_tag.outputs.new_version }}env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- name: Create release package variants@@ -63,85 +43,17 @@ jobs:if: steps.check_release.outputs.exists == 'false'id: release_notesrun: |- # Get commits since last tag- LAST_TAG=${{ steps.get_tag.outputs.latest_tag }}- if [ "$LAST_TAG" = "v0.0.0" ]; then- # Check how many commits we have and use that as the limit- COMMIT_COUNT=$(git rev-list --count HEAD)- if [ "$COMMIT_COUNT" -gt 10 ]; then- COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~10..HEAD)- else- COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~$COMMIT_COUNT..HEAD 2>/dev/null || git log --oneline --pretty=format:"- %s")- fi- else- COMMITS=$(git log --oneline --pretty=format:"- %s" $LAST_TAG..HEAD)- fi-- # Create release notes- cat > release_notes.md << EOF- Template release ${{ steps.get_tag.outputs.new_version }}-- Updated specification-driven development templates for GitHub Copilot, Claude Code, Gemini CLI, Cursor, Qwen, opencode, Windsurf, and Codex.-- Now includes per-script variants for POSIX shell (sh) and PowerShell (ps).-- Download the template for your preferred AI assistant + script type:- - spec-kit-template-copilot-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-copilot-ps-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-claude-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-claude-ps-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-gemini-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-gemini-ps-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-cursor-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-cursor-ps-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-opencode-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-opencode-ps-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-qwen-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-qwen-ps-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-windsurf-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-windsurf-ps-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-codex-sh-${{ steps.get_tag.outputs.new_version }}.zip- - spec-kit-template-codex-ps-${{ steps.get_tag.outputs.new_version }}.zip- EOF-- echo "Generated release notes:"- cat release_notes.md+ chmod +x .github/workflows/scripts/generate-release-notes.sh+ .github/workflows/scripts/generate-release-notes.sh ${{ steps.get_tag.outputs.new_version }} ${{ steps.get_tag.outputs.latest_tag }}- name: Create GitHub Releaseif: steps.check_release.outputs.exists == 'false'run: |- # Remove 'v' prefix from version for release title- VERSION_NO_V=${{ steps.get_tag.outputs.new_version }}- VERSION_NO_V=${VERSION_NO_V#v}-- gh release create ${{ steps.get_tag.outputs.new_version }} \- .genreleases/spec-kit-template-copilot-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-copilot-ps-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-claude-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-claude-ps-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-gemini-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-gemini-ps-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-cursor-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-cursor-ps-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-opencode-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-opencode-ps-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-qwen-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-qwen-ps-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-windsurf-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-windsurf-ps-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-codex-sh-${{ steps.get_tag.outputs.new_version }}.zip \- .genreleases/spec-kit-template-codex-ps-${{ steps.get_tag.outputs.new_version }}.zip \- --title "Spec Kit Templates - $VERSION_NO_V" \- --notes-file release_notes.md+ chmod +x .github/workflows/scripts/create-github-release.sh+ .github/workflows/scripts/create-github-release.sh ${{ steps.get_tag.outputs.new_version }}env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- name: Update version in pyproject.toml (for release artifacts only)if: steps.check_release.outputs.exists == 'false'run: |- # Update version in pyproject.toml (remove 'v' prefix for Python versioning)- VERSION=${{ steps.get_tag.outputs.new_version }}- PYTHON_VERSION=${VERSION#v}-- if [ -f "pyproject.toml" ]; then- sed -i "s/version = \".*\"/version = \"$PYTHON_VERSION\"/" pyproject.toml- echo "Updated pyproject.toml version to $PYTHON_VERSION (for release artifacts only)"- fi+ chmod +x .github/workflows/scripts/update-version.sh+ .github/workflows/scripts/update-version.sh ${{ steps.get_tag.outputs.new_version }}diff --git a/.github/workflows/scripts/check-release-exists.sh b/.github/workflows/scripts/check-release-exists.shnew file mode 100644index 000000000..161bf208c--- /dev/null+++ b/.github/workflows/scripts/check-release-exists.sh@@ -0,0 +1,21 @@+#!/usr/bin/env bash+set -euo pipefail++# check-release-exists.sh+# Check if a GitHub release already exists for the given version+# Usage: check-release-exists.sh <version>++if [[ $# -ne 1 ]]; then+ echo "Usage: $0 <version>" >&2+ exit 1+fi++VERSION="$1"++if gh release view "$VERSION" >/dev/null 2>&1; then+ echo "exists=true" >> $GITHUB_OUTPUT+ echo "Release $VERSION already exists, skipping..."+else+ echo "exists=false" >> $GITHUB_OUTPUT+ echo "Release $VERSION does not exist, proceeding..."+fi\ No newline at end of filediff --git a/.github/workflows/scripts/create-github-release.sh b/.github/workflows/scripts/create-github-release.shnew file mode 100644index 000000000..86ce3f73a--- /dev/null+++ b/.github/workflows/scripts/create-github-release.sh@@ -0,0 +1,36 @@+#!/usr/bin/env bash+set -euo pipefail++# create-github-release.sh+# Create a GitHub release with all template zip files+# Usage: create-github-release.sh <version>++if [[ $# -ne 1 ]]; then+ echo "Usage: $0 <version>" >&2+ exit 1+fi++VERSION="$1"++# Remove 'v' prefix from version for release title+VERSION_NO_V=${VERSION#v}++gh release create "$VERSION" \+ .genreleases/spec-kit-template-copilot-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-copilot-ps-"$VERSION".zip \+ .genreleases/spec-kit-template-claude-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-claude-ps-"$VERSION".zip \+ .genreleases/spec-kit-template-gemini-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-gemini-ps-"$VERSION".zip \+ .genreleases/spec-kit-template-cursor-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-cursor-ps-"$VERSION".zip \+ .genreleases/spec-kit-template-opencode-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-opencode-ps-"$VERSION".zip \+ .genreleases/spec-kit-template-qwen-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-qwen-ps-"$VERSION".zip \+ .genreleases/spec-kit-template-windsurf-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-windsurf-ps-"$VERSION".zip \+ .genreleases/spec-kit-template-codex-sh-"$VERSION".zip \+ .genreleases/spec-kit-template-codex-ps-"$VERSION".zip \+ --title "Spec Kit Templates - $VERSION_NO_V" \+ --notes-file release_notes.md\ No newline at end of filediff --git a/.github/workflows/scripts/generate-release-notes.sh b/.github/workflows/scripts/generate-release-notes.shnew file mode 100644index 000000000..f65992d45--- /dev/null+++ b/.github/workflows/scripts/generate-release-notes.sh@@ -0,0 +1,57 @@+#!/usr/bin/env bash+set -euo pipefail++# generate-release-notes.sh+# Generate release notes from git history+# Usage: generate-release-notes.sh <new_version> <last_tag>++if [[ $# -ne 2 ]]; then+ echo "Usage: $0 <new_version> <last_tag>" >&2+ exit 1+fi++NEW_VERSION="$1"+LAST_TAG="$2"++# Get commits since last tag+if [ "$LAST_TAG" = "v0.0.0" ]; then+ # Check how many commits we have and use that as the limit+ COMMIT_COUNT=$(git rev-list --count HEAD)+ if [ "$COMMIT_COUNT" -gt 10 ]; then+ COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~10..HEAD)+ else+ COMMITS=$(git log --oneline --pretty=format:"- %s" HEAD~$COMMIT_COUNT..HEAD 2>/dev/null || git log --oneline --pretty=format:"- %s")+ fi+else+ COMMITS=$(git log --oneline --pretty=format:"- %s" $LAST_TAG..HEAD)+fi++# Create release notes+cat > release_notes.md << EOF+Template release $NEW_VERSION++Updated specification-driven development templates for GitHub Copilot, Claude Code, Gemini CLI, Cursor, Qwen, opencode, Windsurf, and Codex.++Now includes per-script variants for POSIX shell (sh) and PowerShell (ps).++Download the template for your preferred AI assistant + script type:+- spec-kit-template-copilot-sh-$NEW_VERSION.zip+- spec-kit-template-copilot-ps-$NEW_VERSION.zip+- spec-kit-template-claude-sh-$NEW_VERSION.zip+- spec-kit-template-claude-ps-$NEW_VERSION.zip+- spec-kit-template-gemini-sh-$NEW_VERSION.zip+- spec-kit-template-gemini-ps-$NEW_VERSION.zip+- spec-kit-template-cursor-sh-$NEW_VERSION.zip+- spec-kit-template-cursor-ps-$NEW_VERSION.zip+- spec-kit-template-opencode-sh-$NEW_VERSION.zip+- spec-kit-template-opencode-ps-$NEW_VERSION.zip+- spec-kit-template-qwen-sh-$NEW_VERSION.zip+- spec-kit-template-qwen-ps-$NEW_VERSION.zip+- spec-kit-template-windsurf-sh-$NEW_VERSION.zip+- spec-kit-template-windsurf-ps-$NEW_VERSION.zip+- spec-kit-template-codex-sh-$NEW_VERSION.zip+- spec-kit-template-codex-ps-$NEW_VERSION.zip+EOF++echo "Generated release notes:"+cat release_notes.md\ No newline at end of filediff --git a/.github/workflows/scripts/get-next-version.sh b/.github/workflows/scripts/get-next-version.shnew file mode 100644index 000000000..2be0b6cf8--- /dev/null+++ b/.github/workflows/scripts/get-next-version.sh@@ -0,0 +1,24 @@+#!/usr/bin/env bash+set -euo pipefail++# get-next-version.sh+# Calculate the next version based on the latest git tag and output GitHub Actions variables+# Usage: get-next-version.sh++# Get the latest tag, or use v0.0.0 if no tags exist+LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")+echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT++# Extract version number and increment+VERSION=$(echo $LATEST_TAG | sed 's/v//')+IFS='.' read -ra VERSION_PARTS <<< "$VERSION"+MAJOR=${VERSION_PARTS[0]:-0}+MINOR=${VERSION_PARTS[1]:-0}+PATCH=${VERSION_PARTS[2]:-0}++# Increment patch version+PATCH=$((PATCH + 1))+NEW_VERSION="v$MAJOR.$MINOR.$PATCH"++echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT+echo "New version will be: $NEW_VERSION"\ No newline at end of filediff --git a/.github/workflows/scripts/update-version.sh b/.github/workflows/scripts/update-version.shnew file mode 100644index 000000000..b0dc0e672--- /dev/null+++ b/.github/workflows/scripts/update-version.sh@@ -0,0 +1,23 @@+#!/usr/bin/env bash+set -euo pipefail++# update-version.sh+# Update version in pyproject.toml (for release artifacts only)+# Usage: update-version.sh <version>++if [[ $# -ne 1 ]]; then+ echo "Usage: $0 <version>" >&2+ exit 1+fi++VERSION="$1"++# Remove 'v' prefix for Python versioning+PYTHON_VERSION=${VERSION#v}++if [ -f "pyproject.toml" ]; then+ sed -i "s/version = \".*\"/version = \"$PYTHON_VERSION\"/" pyproject.toml+ echo "Updated pyproject.toml version to $PYTHON_VERSION (for release artifacts only)"+else+ echo "Warning: pyproject.toml not found, skipping version update"+fi\ No newline at end of file