-
Notifications
You must be signed in to change notification settings - Fork 0
feat(f4): marketplace.json + release.yml + bump 0.1.0 (cierre Fase F) #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8f49dbb
829a272
452090c
0bc8392
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "name": "pos-marketplace", | ||
| "owner": { | ||
| "name": "javiAI" | ||
| }, | ||
| "metadata": { | ||
| "description": "Marketplace for the pos Claude Code plugin.", | ||
| "version": "0.1.0" | ||
| }, | ||
| "plugins": [ | ||
| { | ||
| "name": "pos", | ||
| "source": { | ||
| "source": "github", | ||
| "repo": "javiAI/project-operating-system", | ||
| "ref": "v0.1.0" | ||
| }, | ||
| "description": "Generador y sistema operativo determinista para proyectos Claude Code: cuestionario → profile → repo generado con hooks, skills, policy, tests, CI/CD.", | ||
| "version": "0.1.0" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,193 @@ | ||||||||||||||
| name: release | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| push: | ||||||||||||||
| tags: | ||||||||||||||
| - "v*" | ||||||||||||||
|
|
||||||||||||||
| concurrency: | ||||||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||||||
| cancel-in-progress: false | ||||||||||||||
|
|
||||||||||||||
| permissions: | ||||||||||||||
| contents: write | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| version-match: | ||||||||||||||
| name: version-match (plugin.json == tag) | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||||||||||||||
|
|
||||||||||||||
| - name: Assert plugin.json.version == tag without v | ||||||||||||||
| run: | | ||||||||||||||
| set -euo pipefail | ||||||||||||||
| tag="${GITHUB_REF_NAME}" | ||||||||||||||
| expected="${tag#v}" | ||||||||||||||
| actual=$(python3 -c "import json; print(json.load(open('.claude-plugin/plugin.json'))['version'])") | ||||||||||||||
| if [ "$expected" != "$actual" ]; then | ||||||||||||||
| echo "::error ::tag $tag (without v: $expected) != plugin.json.version $actual" | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
| echo "ok: tag=$tag matches plugin.json.version=$actual" | ||||||||||||||
|
|
||||||||||||||
| selftest: | ||||||||||||||
| name: selftest (ubuntu, py 3.11) | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| needs: [version-match] | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Node | ||||||||||||||
| uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 | ||||||||||||||
| with: | ||||||||||||||
| node-version-file: .nvmrc | ||||||||||||||
| cache: npm | ||||||||||||||
|
|
||||||||||||||
| - name: Install Node deps | ||||||||||||||
| run: npm ci | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Python | ||||||||||||||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||||||||||||||
| with: | ||||||||||||||
| python-version: "3.11" | ||||||||||||||
| cache: pip | ||||||||||||||
| cache-dependency-path: requirements-dev.txt | ||||||||||||||
|
|
||||||||||||||
| - name: Install dev deps | ||||||||||||||
| run: python -m pip install --upgrade pip && pip install -r requirements-dev.txt | ||||||||||||||
|
|
||||||||||||||
| - name: Pytest selftest (smoke + scenarios) | ||||||||||||||
| run: pytest bin/tests -q | ||||||||||||||
|
|
||||||||||||||
| build-bundle: | ||||||||||||||
| name: build-bundle (curated plugin-only) | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| needs: [version-match] | ||||||||||||||
| outputs: | ||||||||||||||
|
Comment on lines
+65
to
+69
|
||||||||||||||
| bundle_path: ${{ steps.pack.outputs.bundle_path }} | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||||||||||||||
|
|
||||||||||||||
| - name: Pack curated bundle | ||||||||||||||
| id: pack | ||||||||||||||
| run: | | ||||||||||||||
| set -euo pipefail | ||||||||||||||
| tag="${GITHUB_REF_NAME}" | ||||||||||||||
| bundle="pos-${tag}.tar.gz" | ||||||||||||||
| tar -czf "$bundle" \ | ||||||||||||||
| .claude-plugin \ | ||||||||||||||
| .claude/skills \ | ||||||||||||||
| .claude/rules \ | ||||||||||||||
| hooks \ | ||||||||||||||
| agents \ | ||||||||||||||
| policy.yaml \ | ||||||||||||||
| bin/pos-selftest.sh \ | ||||||||||||||
| bin/_selftest.py \ | ||||||||||||||
| docs/RELEASE.md | ||||||||||||||
| echo "bundle_path=$bundle" >> "$GITHUB_OUTPUT" | ||||||||||||||
| echo "ok: built $bundle" | ||||||||||||||
| ls -lh "$bundle" | ||||||||||||||
|
|
||||||||||||||
| - name: Upload bundle artifact | ||||||||||||||
| uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45581b # v4.6.0 | ||||||||||||||
| with: | ||||||||||||||
| name: pos-bundle | ||||||||||||||
| path: ${{ steps.pack.outputs.bundle_path }} | ||||||||||||||
| if-no-files-found: error | ||||||||||||||
| retention-days: 30 | ||||||||||||||
|
|
||||||||||||||
| publish-release: | ||||||||||||||
| name: publish-release | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| needs: [version-match, selftest, build-bundle] | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||||||||||||||
|
|
||||||||||||||
| - name: Download bundle artifact | ||||||||||||||
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||||||||||||||
| with: | ||||||||||||||
| name: pos-bundle | ||||||||||||||
|
|
||||||||||||||
| - name: Create GitHub release | ||||||||||||||
| env: | ||||||||||||||
| GH_TOKEN: ${{ github.token }} | ||||||||||||||
| run: | | ||||||||||||||
| set -euo pipefail | ||||||||||||||
| tag="${GITHUB_REF_NAME}" | ||||||||||||||
| bundle="pos-${tag}.tar.gz" | ||||||||||||||
| gh release create "$tag" \ | ||||||||||||||
| --title "$tag" \ | ||||||||||||||
| --generate-notes \ | ||||||||||||||
| "$bundle" | ||||||||||||||
|
|
||||||||||||||
| mirror-marketplace: | ||||||||||||||
| name: mirror-marketplace (skippable) | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| needs: [publish-release] | ||||||||||||||
| if: ${{ vars.POS_MARKETPLACE_REPO != '' }} | ||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout | ||||||||||||||
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||||||||||||||
|
|
||||||||||||||
| - name: Open PR against marketplace repo | ||||||||||||||
| env: | ||||||||||||||
| GH_TOKEN: ${{ secrets.POS_MARKETPLACE_TOKEN }} | ||||||||||||||
| MARKETPLACE_REPO: ${{ vars.POS_MARKETPLACE_REPO }} | ||||||||||||||
| run: | | ||||||||||||||
| set -euo pipefail | ||||||||||||||
| tag="${GITHUB_REF_NAME}" | ||||||||||||||
| version="${tag#v}" | ||||||||||||||
| if [ -z "${MARKETPLACE_REPO:-}" ]; then | ||||||||||||||
| echo "POS_MARKETPLACE_REPO unset; skip mirror" | ||||||||||||||
| exit 0 | ||||||||||||||
| fi | ||||||||||||||
| workdir=$(mktemp -d) | ||||||||||||||
| cd "$workdir" | ||||||||||||||
| gh repo clone "$MARKETPLACE_REPO" mp -- --depth=1 | ||||||||||||||
| cd mp | ||||||||||||||
| branch="bump/pos-${version}" | ||||||||||||||
| git checkout -b "$branch" | ||||||||||||||
| python3 - <<PY | ||||||||||||||
| import json, pathlib | ||||||||||||||
| src = json.loads(pathlib.Path('${{ github.workspace }}/.claude-plugin/marketplace.json').read_text()) | ||||||||||||||
| dst_path = pathlib.Path('marketplace.json') | ||||||||||||||
| dst = json.loads(dst_path.read_text()) if dst_path.exists() else src | ||||||||||||||
| plugins = dst.get('plugins') or [] | ||||||||||||||
| target = next((p for p in plugins if p.get('name') == 'pos'), None) | ||||||||||||||
| if target is None: | ||||||||||||||
| plugins.append(src['plugins'][0]) | ||||||||||||||
| else: | ||||||||||||||
| target['source'] = src['plugins'][0]['source'] | ||||||||||||||
| target['version'] = src['plugins'][0]['version'] | ||||||||||||||
| target['description'] = src['plugins'][0].get('description', target.get('description', '')) | ||||||||||||||
| dst['plugins'] = plugins | ||||||||||||||
| dst_path.write_text(json.dumps(dst, indent=2) + '\n') | ||||||||||||||
| PY | ||||||||||||||
| git add marketplace.json | ||||||||||||||
|
||||||||||||||
| git add marketplace.json | |
| git add marketplace.json | |
| if git diff --cached --quiet --exit-code; then | |
| echo "No marketplace changes detected; skip mirror" | |
| exit 0 | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selftestis described as being gated byversion-match("primer gate; sin esto el resto no corre"), but the workflow currently runsselftestin parallel withversion-match(noneeds). This can waste CI time on mismatched tags and contradicts the documented job ordering; addneeds: [version-match]toselftestto makeversion-matcha true gate.