Skip to content

Commit ba7239c

Browse files
committed
Switch skill publish workflow to the shared monorepo action
1 parent 8fc67c5 commit ba7239c

1 file changed

Lines changed: 18 additions & 116 deletions

File tree

.github/workflows/skills-publish.yml

Lines changed: 18 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,16 @@ on:
99
paths:
1010
- SKILL.md
1111
- skill.json
12-
- apis.json
13-
- llms.txt
14-
- schemas/**
15-
- references/**
1612
- package.json
13+
- schemas/**
1714
workflow_dispatch:
1815
inputs:
1916
version:
2017
description: Optional skill version override
2118
required: false
22-
publish-target:
23-
description: Publish target
24-
required: false
25-
default: production
26-
type: choice
27-
options:
28-
- production
29-
- staging
3019
api-base-url:
3120
description: Optional broker API override
3221
required: false
33-
action-ref:
34-
description: skill-publish Git ref override (branch, tag, or SHA)
35-
required: false
36-
default: main
3722

3823
jobs:
3924
publish:
@@ -77,20 +62,9 @@ jobs:
7762
shell: bash
7863
run: |
7964
PACKAGE_DIR=".publish-package-${GITHUB_RUN_ID}"
80-
mkdir -p "${PACKAGE_DIR}/references" "${PACKAGE_DIR}/schemas"
81-
cp SKILL.md skill.json "${PACKAGE_DIR}/"
82-
if [[ -f apis.json ]]; then
83-
cp apis.json "${PACKAGE_DIR}/"
84-
fi
85-
if [[ -f llms.txt ]]; then
86-
cp llms.txt "${PACKAGE_DIR}/"
87-
fi
88-
if compgen -G "references/*.md" >/dev/null; then
89-
cp references/*.md "${PACKAGE_DIR}/references/"
90-
fi
91-
if [[ -f schemas/skill.schema.json ]]; then
92-
cp schemas/skill.schema.json "${PACKAGE_DIR}/schemas/"
93-
fi
65+
mkdir -p "${PACKAGE_DIR}/schemas"
66+
cp SKILL.md skill.json package.json "${PACKAGE_DIR}/"
67+
cp schemas/skill.schema.json "${PACKAGE_DIR}/schemas/"
9468
echo "dir=${PACKAGE_DIR}" >> "$GITHUB_OUTPUT"
9569
- name: Resolve version
9670
id: vars
@@ -118,100 +92,28 @@ jobs:
11892
11993
echo "name=$SKILL_NAME" >> "$GITHUB_OUTPUT"
12094
echo "version=$VERSION_INPUT" >> "$GITHUB_OUTPUT"
121-
- name: Resolve publish target
95+
- name: Resolve broker API URL
12296
id: target
12397
shell: bash
12498
run: |
125-
TARGET_INPUT="${{ github.event.inputs.publish-target }}"
126-
if [[ -z "$TARGET_INPUT" ]]; then
127-
TARGET_INPUT="production"
128-
fi
129-
13099
API_BASE_URL_INPUT="${{ github.event.inputs.api-base-url }}"
131100
if [[ -n "$API_BASE_URL_INPUT" ]]; then
132101
API_BASE_URL="$API_BASE_URL_INPUT"
133-
elif [[ "$TARGET_INPUT" == "staging" ]]; then
134-
API_BASE_URL="https://registry-staging.hol.org/registry/api/v1"
135102
else
136-
API_BASE_URL="https://hol.org/registry/api/v1"
103+
API_BASE_URL="${{ secrets.RB_BASE_URL }}"
137104
fi
138-
139-
ACTION_REF_INPUT="${{ github.event.inputs.action-ref }}"
140-
if [[ -z "$ACTION_REF_INPUT" ]]; then
141-
ACTION_REF_INPUT="main"
142-
fi
143-
144-
SUBMIT_INDEXNOW="true"
145-
if [[ "$TARGET_INPUT" == "staging" ]]; then
146-
SUBMIT_INDEXNOW="false"
105+
if [[ -z "$API_BASE_URL" ]]; then
106+
API_BASE_URL="https://hol.org/registry/api/v1"
147107
fi
148-
149-
echo "target=$TARGET_INPUT" >> "$GITHUB_OUTPUT"
150108
echo "api_base_url=$API_BASE_URL" >> "$GITHUB_OUTPUT"
151-
echo "action_ref=$ACTION_REF_INPUT" >> "$GITHUB_OUTPUT"
152-
echo "submit_indexnow=$SUBMIT_INDEXNOW" >> "$GITHUB_OUTPUT"
153-
- name: Checkout skill publish action
154-
uses: actions/checkout@v4
109+
- name: Publish skill package
110+
uses: hashgraph-online/hashgraph-online/.github/actions/skills-publish@main
155111
with:
156-
repository: hashgraph-online/skill-publish
157-
ref: ${{ steps.target.outputs.action_ref }}
158-
path: .skill-publish-action
159-
- name: Patch skill publish action endpoint compatibility
160-
shell: bash
161-
run: |
162-
node <<'NODE'
163-
const fs = require('node:fs');
164-
const file = '.skill-publish-action/entrypoint.mjs';
165-
const content = fs.readFileSync(file, 'utf8');
166-
if (!content.includes('/skills/list')) {
167-
console.log('No /skills/list endpoint detected; no patch needed.');
168-
process.exit(0);
169-
}
170-
const updated = content.replace('/skills/list', '/skills');
171-
fs.writeFileSync(file, updated);
172-
console.log('Patched skill-publish action to use /skills endpoint.');
173-
NODE
174-
- name: Verify staging API key secret
175-
if: steps.target.outputs.target == 'staging'
176-
shell: bash
177-
env:
178-
RB_API_KEY_STAGING: ${{ secrets.RB_API_KEY_STAGING }}
179-
run: |
180-
if [[ -z "$RB_API_KEY_STAGING" ]]; then
181-
echo "RB_API_KEY_STAGING secret is required for staging publishes."
182-
exit 1
183-
fi
184-
- name: Publish skill package (production)
185-
if: steps.target.outputs.target != 'staging'
186-
shell: bash
187-
env:
188-
INPUT_API_BASE_URL: ${{ steps.target.outputs.api_base_url }}
189-
INPUT_API_KEY: ${{ secrets.RB_API_KEY }}
190-
INPUT_ACCOUNT_ID: ""
191-
INPUT_SKILL_DIR: ${{ steps.package.outputs.dir }}
192-
INPUT_NAME: ${{ steps.vars.outputs.name }}
193-
INPUT_VERSION: ${{ steps.vars.outputs.version }}
194-
INPUT_STAMP_REPO_COMMIT: "true"
195-
INPUT_POLL_TIMEOUT_MS: "720000"
196-
INPUT_POLL_INTERVAL_MS: "4000"
197-
INPUT_ANNOTATE: "true"
198-
INPUT_SUBMIT_INDEXNOW: ${{ steps.target.outputs.submit_indexnow }}
199-
INPUT_GITHUB_TOKEN: ${{ github.token }}
200-
run: node .skill-publish-action/entrypoint.mjs
201-
- name: Publish skill package (staging)
202-
if: steps.target.outputs.target == 'staging'
203-
shell: bash
204-
env:
205-
INPUT_API_BASE_URL: ${{ steps.target.outputs.api_base_url }}
206-
INPUT_API_KEY: ${{ secrets.RB_API_KEY_STAGING }}
207-
INPUT_ACCOUNT_ID: ""
208-
INPUT_SKILL_DIR: ${{ steps.package.outputs.dir }}
209-
INPUT_NAME: ${{ steps.vars.outputs.name }}
210-
INPUT_VERSION: ${{ steps.vars.outputs.version }}
211-
INPUT_STAMP_REPO_COMMIT: "true"
212-
INPUT_POLL_TIMEOUT_MS: "720000"
213-
INPUT_POLL_INTERVAL_MS: "4000"
214-
INPUT_ANNOTATE: "true"
215-
INPUT_SUBMIT_INDEXNOW: ${{ steps.target.outputs.submit_indexnow }}
216-
INPUT_GITHUB_TOKEN: ${{ github.token }}
217-
run: node .skill-publish-action/entrypoint.mjs
112+
api-base-url: ${{ steps.target.outputs.api_base_url }}
113+
api-key: ${{ secrets.RB_API_KEY }}
114+
account-id: ${{ secrets.RB_ACCOUNT_ID }}
115+
skill-dir: ${{ steps.package.outputs.dir }}
116+
name: ${{ steps.vars.outputs.name }}
117+
version: ${{ steps.vars.outputs.version }}
118+
annotate: "true"
119+
github-token: ${{ github.token }}

0 commit comments

Comments
 (0)