Update release file

This commit is contained in:
Den Delimarsky 🌺
2025-09-11 23:41:45 -07:00
parent ee6b83c1dd
commit 4b66f216e9
3 changed files with 91 additions and 117 deletions

View File

@@ -61,8 +61,8 @@ jobs:
- name: Create release package - name: Create release package
if: steps.check_release.outputs.exists == 'false' if: steps.check_release.outputs.exists == 'false'
run: | run: |
chmod +x scripts/create-release-packages.sh chmod +x .github/workflows/scripts/create-release-packages.sh
./scripts/create-release-packages.sh ${{ steps.get_tag.outputs.new_version }} .github/workflows/scripts/create-release-packages.sh ${{ steps.get_tag.outputs.new_version }}
- name: Generate release notes - name: Generate release notes
if: steps.check_release.outputs.exists == 'false' if: steps.check_release.outputs.exists == 'false'

View File

@@ -0,0 +1,89 @@
#!/usr/bin/env bash
set -euo pipefail
# create-release-packages.sh (workflow-local)
# Build Spec Kit template release archives for each supported AI assistant.
# Usage: .github/workflows/scripts/create-release-packages.sh <version>
# Version argument should include leading 'v'.
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <version-with-v-prefix>" >&2
exit 1
fi
NEW_VERSION="$1"
if [[ ! $NEW_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Version must look like v0.0.0" >&2
exit 1
fi
echo "Building release packages for $NEW_VERSION"
rm -rf sdd-package-base sdd-claude-package sdd-gemini-package sdd-copilot-package \
spec-kit-template-claude-${NEW_VERSION}.zip \
spec-kit-template-gemini-${NEW_VERSION}.zip \
spec-kit-template-copilot-${NEW_VERSION}.zip || true
mkdir -p sdd-package-base
SPEC_DIR="sdd-package-base/.specify"
mkdir -p "$SPEC_DIR"
[[ -d memory ]] && { cp -r memory "$SPEC_DIR/"; echo "Copied memory -> .specify"; }
[[ -d scripts ]] && { mkdir -p "$SPEC_DIR/scripts"; rsync -a scripts/ "$SPEC_DIR/scripts/" --exclude 'create-release-packages.sh'; echo "Copied scripts -> .specify/scripts"; }
[[ -d templates ]] && { mkdir -p "$SPEC_DIR/templates"; find templates -type f -not -path "templates/commands/*" -exec cp --parents {} "$SPEC_DIR"/ \;; echo "Copied templates -> .specify/templates"; }
rewrite_paths() {
sed -E \
-e 's@(/?)memory/@.specify/memory/@g' \
-e 's@(/?)scripts/@.specify/scripts/@g' \
-e 's@(/?)templates/@.specify/templates/@g'
}
generate_commands() {
local agent=$1 ext=$2 arg_format=$3 output_dir=$4
mkdir -p "$output_dir"
for template in templates/commands/*.md; do
[[ -f "$template" ]] || continue
local name description body
name=$(basename "$template" .md)
description=$(awk '/^description:/ {gsub(/^description: *"?/, ""); gsub(/"$/, ""); print; exit}' "$template" | tr -d '\r')
body=$(awk '/^---$/{if(++count==2) start=1; next} start' "$template" | sed "s/{ARGS}/$arg_format/g" | rewrite_paths)
case $ext in
toml)
{ echo "description = \"$description\""; echo; echo "prompt = \"\"\""; echo "$body"; echo "\"\"\""; } > "$output_dir/$name.$ext" ;;
md)
echo "$body" > "$output_dir/$name.$ext" ;;
prompt.md)
sed "s/{ARGS}/$arg_format/g" "$template" | rewrite_paths > "$output_dir/$name.$ext" ;;
esac
done
}
mkdir -p sdd-claude-package
cp -r sdd-package-base/* sdd-claude-package/
mkdir -p sdd-claude-package/.claude/commands
generate_commands claude md "\$ARGUMENTS" sdd-claude-package/.claude/commands
echo "Created Claude package"
mkdir -p sdd-gemini-package
cp -r sdd-package-base/* sdd-gemini-package/
mkdir -p sdd-gemini-package/.gemini/commands
generate_commands gemini toml "{{args}}" sdd-gemini-package/.gemini/commands
[[ -f agent_templates/gemini/GEMINI.md ]] && cp agent_templates/gemini/GEMINI.md sdd-gemini-package/GEMINI.md
echo "Created Gemini package"
mkdir -p sdd-copilot-package
cp -r sdd-package-base/* sdd-copilot-package/
mkdir -p sdd-copilot-package/.github/prompts
generate_commands copilot prompt.md "\$ARGUMENTS" sdd-copilot-package/.github/prompts
echo "Created Copilot package"
( cd sdd-claude-package && zip -r ../spec-kit-template-claude-${NEW_VERSION}.zip . )
( cd sdd-gemini-package && zip -r ../spec-kit-template-gemini-${NEW_VERSION}.zip . )
( cd sdd-copilot-package && zip -r ../spec-kit-template-copilot-${NEW_VERSION}.zip . )
echo "Archives:"
ls -1 spec-kit-template-*-${NEW_VERSION}.zip
unzip -l spec-kit-template-copilot-${NEW_VERSION}.zip | head -10 || true

View File

@@ -1,115 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# create-release-packages.sh
# Build Spec Kit template release archives for each supported AI assistant.
# Usage: ./scripts/create-release-packages.sh <version>
# <version> should include the leading 'v' (e.g. v0.0.4)
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <version-with-v-prefix>" >&2
exit 1
fi
NEW_VERSION="$1"
if [[ ! $NEW_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Version must look like v0.0.0" >&2
exit 1
fi
echo "Building release packages for $NEW_VERSION"
# Clean any previous build dirs
rm -rf sdd-package-base sdd-claude-package sdd-gemini-package sdd-copilot-package \
spec-kit-template-claude-${NEW_VERSION}.zip \
spec-kit-template-gemini-${NEW_VERSION}.zip \
spec-kit-template-copilot-${NEW_VERSION}.zip || true
mkdir -p sdd-package-base
# Copy common folders to base
if [[ -d memory ]]; then
cp -r memory sdd-package-base/
echo "Copied memory folder"
fi
if [[ -d scripts ]]; then
# Exclude this script itself from being copied
rsync -a --exclude 'create-release-packages.sh' scripts/ sdd-package-base/scripts/
echo "Copied scripts folder (excluding create-release-packages.sh)"
fi
if [[ -d templates ]]; then
mkdir -p sdd-package-base/templates
# Copy all template files excluding commands (processed separately per assistant)
find templates -type f -not -path "templates/commands/*" -exec cp --parents {} sdd-package-base/ \;
echo "Copied templates folder (excluding commands directory)"
fi
# Function to generate assistant command files/prompts
# Args: agent ext arg_format output_dir
generate_commands() {
local agent=$1
local ext=$2
local arg_format=$3
local output_dir=$4
mkdir -p "$output_dir"
for template in templates/commands/*.md; do
[[ -f "$template" ]] || continue
local name
name=$(basename "$template" .md)
local description
description=$(awk '/^description:/ {gsub(/^description: *"?/, ""); gsub(/"$/, ""); print; exit}' "$template" | tr -d '\r')
local content
content=$(awk '/^---$/{if(++count==2) start=1; next} start' "$template" | sed "s/{ARGS}/$arg_format/g")
case $ext in
"toml")
{
echo "description = \"$description\""; echo ""; echo "prompt = \"\"\""; echo "$content"; echo "\"\"\"";
} > "$output_dir/$name.$ext"
;;
"md")
echo "$content" > "$output_dir/$name.$ext"
;;
"prompt.md")
# Preserve front matter exactly, just substitute {ARGS}
sed "s/{ARGS}/$arg_format/g" "$template" > "$output_dir/$name.$ext"
;;
esac
done
}
# Claude package
mkdir -p sdd-claude-package
cp -r sdd-package-base/* sdd-claude-package/
mkdir -p sdd-claude-package/.claude/commands
generate_commands "claude" "md" "\$ARGUMENTS" "sdd-claude-package/.claude/commands"
echo "Created Claude Code package"
# Gemini package
mkdir -p sdd-gemini-package
cp -r sdd-package-base/* sdd-gemini-package/
mkdir -p sdd-gemini-package/.gemini/commands
generate_commands "gemini" "toml" "{{args}}" "sdd-gemini-package/.gemini/commands"
if [[ -f agent_templates/gemini/GEMINI.md ]]; then
cp agent_templates/gemini/GEMINI.md sdd-gemini-package/GEMINI.md
fi
echo "Created Gemini CLI package"
# Copilot package
mkdir -p sdd-copilot-package
cp -r sdd-package-base/* sdd-copilot-package/
mkdir -p sdd-copilot-package/.github/prompts
generate_commands "copilot" "prompt.md" "\$ARGUMENTS" "sdd-copilot-package/.github/prompts"
echo "Created GitHub Copilot package"
# Archives
( cd sdd-claude-package && zip -r ../spec-kit-template-claude-${NEW_VERSION}.zip . )
( cd sdd-gemini-package && zip -r ../spec-kit-template-gemini-${NEW_VERSION}.zip . )
( cd sdd-copilot-package && zip -r ../spec-kit-template-copilot-${NEW_VERSION}.zip . )
echo "Package archives created:"
ls -1 spec-kit-template-*-${NEW_VERSION}.zip
# Basic verification snippet
unzip -l spec-kit-template-copilot-${NEW_VERSION}.zip | head -10 || true