-
Notifications
You must be signed in to change notification settings - Fork 1
ci: ClawHub publish workflow (release + manual dry-run) #3
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: Publish to ClawHub | ||
|
|
||
| # Publishes the skill payload (wordpress-api-pro/) to ClawHub. | ||
| # | ||
| # Triggers: | ||
| # - on a published GitHub Release → real publish | ||
| # - manual run (workflow_dispatch) → choose dry-run or real publish | ||
| # | ||
| # Setup (one-time): add a repo secret named CLAWHUB_TOKEN | ||
| # (Settings → Secrets and variables → Actions → New repository secret). | ||
| # Get the token from `clawhub login` locally, or your ClawHub account settings. | ||
| # | ||
| # The version is read from the skill's SKILL.md front matter (`version:`), | ||
| # the single source of truth ClawHub displays — bump it there before releasing. | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: "Build the publish plan without uploading" | ||
| type: boolean | ||
| default: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: clawhub-publish | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish skill | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| SKILL_DIR: wordpress-api-pro | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
|
|
||
| - name: Install ClawHub CLI | ||
| run: npm i -g clawhub | ||
|
|
||
| - name: Read skill version from SKILL.md | ||
| id: ver | ||
| run: | | ||
| VERSION=$(grep -m1 '^version:' "$SKILL_DIR/SKILL.md" | sed 's/^version:[[:space:]]*//' | tr -d '"' | tr -d "'" | xargs) | ||
| if [ -z "$VERSION" ]; then | ||
| echo "::error::Could not read 'version:' from $SKILL_DIR/SKILL.md" | ||
| exit 1 | ||
| fi | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "Skill version: $VERSION" | ||
|
|
||
| - name: Authenticate | ||
| env: | ||
| CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }} | ||
| run: | | ||
| if [ -z "$CLAWHUB_TOKEN" ]; then | ||
| echo "::error::CLAWHUB_TOKEN secret is not set. Add it under Settings → Secrets → Actions." | ||
| exit 1 | ||
| fi | ||
| clawhub login --token "$CLAWHUB_TOKEN" | ||
|
|
||
| - name: Publish | ||
| env: | ||
| DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }} | ||
| run: | | ||
| ARGS=("$SKILL_DIR" --version "${{ steps.ver.outputs.version }}") | ||
| if [ "$DRY_RUN" = "true" ]; then | ||
| echo "Dry run — no upload." | ||
| ARGS+=(--dry-run) | ||
| fi | ||
| clawhub skill publish "${ARGS[@]}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
For manual workflow runs with the default
dry_run: true, this appends--dry-runtoclawhub skill publish, but the ClawHub CLI reference documentsskill publish <path>with publish flags such as--version/--ownerand documents dry-run support onsync/package publishing instead; the official skill-publish workflow builds previews withclawhub sync --all --dry-run. As written, the advertised manual preview path is likely to fail before producing a publish plan, so use the supported sync dry-run flow or remove the unsupported flag forskill publish.Useful? React with 👍 / 👎.