mirror of
https://github.com/AvdLee/Core-Data-Agent-Skill.git
synced 2026-09-19 03:33:29 +08:00
7f66a470ac
Add a root plugin.json manifest and move the skill to the canonical skills/core-data-expert/ location per the Agent Plugins specification (https://agent-plugins.org). A symlink at the old root path keeps existing clones and scripts working until the next major version. Also completes client wrapper coverage: new Cursor plugin manifest with logo, pi package.json, and Codex agents/openai.yaml including ChatGPT desktop interface metadata. Release workflow now bumps every manifest.
119 lines
3.8 KiB
YAML
119 lines
3.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Version to release (e.g. 1.0.2)"
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
VERSION: ${{ inputs.version }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Validate version input
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Error: Invalid version '$VERSION'. Expected format like 1.0.2."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Fail if tag already exists
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
if git rev-parse -q --verify "refs/tags/$VERSION" >/dev/null; then
|
|
echo "Error: Tag $VERSION already exists. Refusing to re-release the same version."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Fail if version is not higher than latest release
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
latest_tag="$(git tag -l '[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n 1)"
|
|
if [[ -z "$latest_tag" ]]; then
|
|
echo "No existing semver tags found. Proceeding with $VERSION."
|
|
exit 0
|
|
fi
|
|
|
|
latest_version="$latest_tag"
|
|
|
|
if [[ "$VERSION" == "$latest_version" ]]; then
|
|
echo "Error: Version $VERSION equals latest released version $latest_version. Use a higher version."
|
|
exit 1
|
|
fi
|
|
|
|
greatest="$(printf '%s\n%s\n' "$latest_version" "$VERSION" | sort -V | tail -n 1)"
|
|
if [[ "$greatest" != "$VERSION" ]]; then
|
|
echo "Error: Version $VERSION must be higher than latest released version $latest_version."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Bump manifest versions
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
for manifest in plugin.json .claude-plugin/plugin.json .cursor-plugin/plugin.json; do
|
|
jq --arg v "$VERSION" '.version = $v' "$manifest" > "$manifest.tmp"
|
|
if [ -s "$manifest.tmp" ]; then
|
|
mv "$manifest.tmp" "$manifest"
|
|
else
|
|
echo "Error: Failed to generate updated $manifest"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
sed -i -E "s/^version: \".*\"$/version: \"$VERSION\"/" agents/openai.yaml
|
|
|
|
- name: Bump marketplace.json versions
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
jq --arg v "$VERSION" '.version = $v | .plugins[0].version = $v' .claude-plugin/marketplace.json > .claude-plugin/marketplace.json.tmp
|
|
if [ -s .claude-plugin/marketplace.json.tmp ]; then
|
|
mv .claude-plugin/marketplace.json.tmp .claude-plugin/marketplace.json
|
|
else
|
|
echo "Error: Failed to generate updated .claude-plugin/marketplace.json"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Commit and push version bump
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
version_files="plugin.json .claude-plugin/plugin.json .claude-plugin/marketplace.json .cursor-plugin/plugin.json agents/openai.yaml"
|
|
if git diff --quiet $version_files; then
|
|
echo "No changes detected — version files already at $VERSION (previous run may have pushed but not released). Skipping commit."
|
|
else
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add $version_files
|
|
git commit -m "Bump version to $VERSION"
|
|
git push
|
|
fi
|
|
|
|
- name: Create tag and GitHub release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ inputs.version }}
|
|
generate_release_notes: true
|