mirror of
https://github.com/walter-base/common-workflow.git
synced 2026-09-08 19:26:46 -04:00
175 lines
6.0 KiB
YAML
175 lines
6.0 KiB
YAML
name: Agent marketplace release
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
skill_root:
|
|
description: Canonical skill directory relative to the repository root.
|
|
required: false
|
|
type: string
|
|
default: skills
|
|
claude_marketplace_file:
|
|
description: Claude marketplace manifest relative to the repository root.
|
|
required: false
|
|
type: string
|
|
default: .claude-plugin/marketplace.json
|
|
claude_plugin_file:
|
|
description: Claude plugin manifest relative to the repository root.
|
|
required: false
|
|
type: string
|
|
default: .claude-plugin/plugin.json
|
|
codex_plugin_root:
|
|
description: Codex plugin root relative to the repository root.
|
|
required: false
|
|
type: string
|
|
cursor_plugin_root:
|
|
description: Cursor plugin root relative to the repository root.
|
|
required: false
|
|
type: string
|
|
release_config_file:
|
|
description: Release Please configuration file.
|
|
required: false
|
|
type: string
|
|
default: release-please-config.json
|
|
release_manifest_file:
|
|
description: Release Please manifest file.
|
|
required: false
|
|
type: string
|
|
default: .release-please-manifest.json
|
|
package_paths:
|
|
description: Space-separated paths to package into the release archive.
|
|
required: false
|
|
type: string
|
|
default: skills .claude-plugin .cursor-plugin .agents plugins README.md CHANGELOG.md
|
|
archive_name:
|
|
description: Prefix used for the release archive.
|
|
required: false
|
|
type: string
|
|
default: agent-marketplace
|
|
claude_plugin_name:
|
|
description: Claude plugin name used in the installation summary.
|
|
required: false
|
|
type: string
|
|
default: marketplace
|
|
claude_marketplace_name:
|
|
description: Claude marketplace name used in the installation summary.
|
|
required: false
|
|
type: string
|
|
default: marketplace
|
|
codex_marketplace_name:
|
|
description: Codex marketplace name shown in the installation summary.
|
|
required: false
|
|
type: string
|
|
default: marketplace
|
|
cursor_plugin_name:
|
|
description: Cursor plugin name shown in the installation summary.
|
|
required: false
|
|
type: string
|
|
default: marketplace
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
concurrency:
|
|
group: release-please
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
release-please:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
version: ${{ steps.release.outputs.version }}
|
|
steps:
|
|
- name: Create or update release PR
|
|
id: release
|
|
uses: googleapis/release-please-action@v4
|
|
with:
|
|
token: ${{ github.token }}
|
|
target-branch: ${{ github.event.repository.default_branch || 'master' }}
|
|
config-file: ${{ inputs.release_config_file }}
|
|
manifest-file: ${{ inputs.release_manifest_file }}
|
|
|
|
publish:
|
|
needs: release-please
|
|
if: needs.release-please.outputs.release_created == 'true'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Check out released version
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ needs.release-please.outputs.tag_name }}
|
|
- name: Validate released marketplace
|
|
uses: walter-base/common-workflow/actions/validate-agent-marketplace@master
|
|
with:
|
|
skill_root: ${{ inputs.skill_root }}
|
|
claude_marketplace_file: ${{ inputs.claude_marketplace_file }}
|
|
claude_plugin_file: ${{ inputs.claude_plugin_file }}
|
|
codex_plugin_root: ${{ inputs.codex_plugin_root }}
|
|
cursor_plugin_root: ${{ inputs.cursor_plugin_root }}
|
|
- name: Build release archive
|
|
env:
|
|
VERSION: ${{ needs.release-please.outputs.version }}
|
|
PACKAGE_PATHS: ${{ inputs.package_paths }}
|
|
ARCHIVE_NAME: ${{ inputs.archive_name }}
|
|
shell: bash
|
|
run: |
|
|
dir="${ARCHIVE_NAME}-${VERSION}"
|
|
mkdir -p "dist/${dir}"
|
|
for path in ${PACKAGE_PATHS}; do
|
|
cp -R "$path" "dist/${dir}/"
|
|
done
|
|
tar -czf "dist/${dir}.tar.gz" -C dist "${dir}"
|
|
- name: Write installation summary
|
|
env:
|
|
VERSION: ${{ needs.release-please.outputs.version }}
|
|
TAG: ${{ needs.release-please.outputs.tag_name }}
|
|
REPOSITORY: ${{ github.repository }}
|
|
SERVER_URL: ${{ github.server_url }}
|
|
SKILL_ROOT: ${{ inputs.skill_root }}
|
|
CLAUDE_PLUGIN_NAME: ${{ inputs.claude_plugin_name }}
|
|
CLAUDE_MARKETPLACE_NAME: ${{ inputs.claude_marketplace_name }}
|
|
CODEX_MARKETPLACE_NAME: ${{ inputs.codex_marketplace_name }}
|
|
CURSOR_PLUGIN_NAME: ${{ inputs.cursor_plugin_name }}
|
|
run: |
|
|
cat >> "$GITHUB_STEP_SUMMARY" <<EOF
|
|
# Agent marketplace ${VERSION}
|
|
|
|
Release tag: \`${TAG}\`
|
|
|
|
## Claude Code
|
|
|
|
\`\`\`bash
|
|
claude plugin marketplace add ${REPOSITORY}@${TAG}
|
|
claude plugin install ${CLAUDE_PLUGIN_NAME}@${CLAUDE_MARKETPLACE_NAME}
|
|
\`\`\`
|
|
|
|
## Codex
|
|
|
|
\`\`\`bash
|
|
codex plugin marketplace add ${REPOSITORY} --ref ${TAG}
|
|
codex
|
|
# In Codex, run: /plugins and install ${CODEX_MARKETPLACE_NAME}.
|
|
\`\`\`
|
|
|
|
## OpenCode
|
|
|
|
\`\`\`bash
|
|
npx skills add ${SERVER_URL}/${REPOSITORY}/tree/${TAG}/${SKILL_ROOT} --agent opencode --skill '*'
|
|
\`\`\`
|
|
|
|
## Cursor
|
|
|
|
\`\`\`bash
|
|
npx skills add ${SERVER_URL}/${REPOSITORY}/tree/${TAG}/${SKILL_ROOT} --agent cursor --skill '*'
|
|
\`\`\`
|
|
EOF
|
|
- name: Upload archive to GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ needs.release-please.outputs.tag_name }}
|
|
files: dist/${{ inputs.archive_name }}-*.tar.gz
|