Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish to ClawHub

on:
push:
tags:
- "v*"

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest
environment: release

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.1

- name: Set up Node.js
uses: actions/setup-node@v4
with:
Comment on lines +17 to +27

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but we're intentionally keeping major-version tags (@v4) here.

node-version: 24
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
# ClawHub packs the folder with `npm pack --ignore-scripts`, so the
# compiled `dist/` must already exist on disk before publishing.
run: pnpm run build

- name: Install ClawHub CLI
run: npm install -g clawhub@latest
Comment on lines +39 to +40

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional: the ClawHub CLI talks to the live registry, whose API moves quickly


- name: Sign in to ClawHub
env:
CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }}
run: |
if [ -z "$CLAWHUB_TOKEN" ]; then
echo "::error::CLAWHUB_TOKEN secret is required to publish."
exit 1
fi
clawhub login --token "$CLAWHUB_TOKEN"
clawhub whoami

- name: ClawHub validate
run: clawhub package validate .

- name: ClawHub publish (dry run)
run: clawhub package publish . --family code-plugin --dry-run

- name: ClawHub publish
run: clawhub package publish . --family code-plugin
53 changes: 53 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Validate Plugin

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
Comment thread
Copilot marked this conversation as resolved.
validate:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [22, 24]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.1

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Comment on lines +23 to +33

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but we're intentionally keeping major-version tags (@v4) here.

node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Typecheck
run: pnpm run typecheck

- name: Build
run: pnpm run build

- name: Install ClawHub CLI
run: npm install -g clawhub@latest

- name: ClawHub validate
run: clawhub package validate .

- name: ClawHub publish (dry run)
run: clawhub package publish . --family code-plugin --dry-run
Comment on lines +46 to +53

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified this isn't the case: clawhub package validate and clawhub package publish --dry-run both succeed without authentication

Loading