Update script delegation from GitHub Action
This commit is contained in:
108
.github/workflows/release.yml
vendored
108
.github/workflows/release.yml
vendored
@@ -25,33 +25,13 @@ jobs:
|
|||||||
- name: Get latest tag
|
- name: Get latest tag
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: |
|
run: |
|
||||||
# Get the latest tag, or use v0.0.0 if no tags exist
|
chmod +x .github/workflows/scripts/get-next-version.sh
|
||||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
.github/workflows/scripts/get-next-version.sh
|
||||||
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"
|
|
||||||
- name: Check if release already exists
|
- name: Check if release already exists
|
||||||
id: check_release
|
id: check_release
|
||||||
run: |
|
run: |
|
||||||
if gh release view ${{ steps.get_tag.outputs.new_version }} >/dev/null 2>&1; then
|
chmod +x .github/workflows/scripts/check-release-exists.sh
|
||||||
echo "exists=true" >> $GITHUB_OUTPUT
|
.github/workflows/scripts/check-release-exists.sh ${{ steps.get_tag.outputs.new_version }}
|
||||||
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
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Create release package variants
|
- name: Create release package variants
|
||||||
@@ -63,85 +43,17 @@ jobs:
|
|||||||
if: steps.check_release.outputs.exists == 'false'
|
if: steps.check_release.outputs.exists == 'false'
|
||||||
id: release_notes
|
id: release_notes
|
||||||
run: |
|
run: |
|
||||||
# Get commits since last tag
|
chmod +x .github/workflows/scripts/generate-release-notes.sh
|
||||||
LAST_TAG=${{ steps.get_tag.outputs.latest_tag }}
|
.github/workflows/scripts/generate-release-notes.sh ${{ steps.get_tag.outputs.new_version }} ${{ 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
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
if: steps.check_release.outputs.exists == 'false'
|
if: steps.check_release.outputs.exists == 'false'
|
||||||
run: |
|
run: |
|
||||||
# Remove 'v' prefix from version for release title
|
chmod +x .github/workflows/scripts/create-github-release.sh
|
||||||
VERSION_NO_V=${{ steps.get_tag.outputs.new_version }}
|
.github/workflows/scripts/create-github-release.sh ${{ 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
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Update version in pyproject.toml (for release artifacts only)
|
- name: Update version in pyproject.toml (for release artifacts only)
|
||||||
if: steps.check_release.outputs.exists == 'false'
|
if: steps.check_release.outputs.exists == 'false'
|
||||||
run: |
|
run: |
|
||||||
# Update version in pyproject.toml (remove 'v' prefix for Python versioning)
|
chmod +x .github/workflows/scripts/update-version.sh
|
||||||
VERSION=${{ steps.get_tag.outputs.new_version }}
|
.github/workflows/scripts/update-version.sh ${{ 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
|
|
||||||
|
|||||||
21
.github/workflows/scripts/check-release-exists.sh
vendored
Normal file
21
.github/workflows/scripts/check-release-exists.sh
vendored
Normal file
@@ -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
|
||||||
36
.github/workflows/scripts/create-github-release.sh
vendored
Normal file
36
.github/workflows/scripts/create-github-release.sh
vendored
Normal file
@@ -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
|
||||||
57
.github/workflows/scripts/generate-release-notes.sh
vendored
Normal file
57
.github/workflows/scripts/generate-release-notes.sh
vendored
Normal file
@@ -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
|
||||||
24
.github/workflows/scripts/get-next-version.sh
vendored
Normal file
24
.github/workflows/scripts/get-next-version.sh
vendored
Normal file
@@ -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"
|
||||||
23
.github/workflows/scripts/update-version.sh
vendored
Normal file
23
.github/workflows/scripts/update-version.sh
vendored
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user