-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add GitHub Actions for ClawHub validation and tag-based publishing #2
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
base: main
Are you sure you want to change the base?
Changes from all commits
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,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: | ||
| 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| 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: | ||
|
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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified this isn't the case: |
||
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.
Thanks, but we're intentionally keeping major-version tags (@v4) here.