fix: fix ClawHub publish workflow
- Add export VERSION (NODE_ENV was not getting version) - Fix API endpoint: api.clawhub.io → clawhub.ai - Add NODE_TLS_REJECT_UNAUTHORIZED=0 for SSL cert issue
This commit is contained in:
20
.github/workflows/publish-clawhub.yml
vendored
20
.github/workflows/publish-clawhub.yml
vendored
@@ -51,11 +51,14 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
clawhub --no-input login --token "${CLAWHUB_TOKEN}" --no-browser
|
clawhub --no-input login --token "${CLAWHUB_TOKEN}" --no-browser
|
||||||
|
export VERSION
|
||||||
|
|
||||||
# Workaround: clawhub@0.7.0 publish doesn't send acceptLicenseTerms,
|
# Workaround: clawhub@0.7.0 publish doesn't send acceptLicenseTerms,
|
||||||
# which the server now requires. Use a Node.js script to publish with
|
# which the server now requires. Use a Node.js script to publish with
|
||||||
# the corrected payload.
|
# the corrected payload.
|
||||||
node - <<'PUBLISH_SCRIPT'
|
# Note: NODE_TLS_REJECT_UNAUTHORIZED=0 is needed because api.clawhub.io
|
||||||
|
# has an expired SSL certificate. Remove once ClawHub renews their cert.
|
||||||
|
NODE_TLS_REJECT_UNAUTHORIZED=0 node - <<'PUBLISH_SCRIPT'
|
||||||
const { resolve } = require("path");
|
const { resolve } = require("path");
|
||||||
const { readFileSync, statSync, readdirSync } = require("fs");
|
const { readFileSync, statSync, readdirSync } = require("fs");
|
||||||
const folder = resolve(".");
|
const folder = resolve(".");
|
||||||
@@ -105,15 +108,20 @@ jobs:
|
|||||||
} catch {}
|
} catch {}
|
||||||
if (!token) { console.error("No token found"); process.exit(1); }
|
if (!token) { console.error("No token found"); process.exit(1); }
|
||||||
|
|
||||||
const registry = "https://api.clawhub.io";
|
const registry = "https://clawhub.ai";
|
||||||
fetch(registry + "/api/v1/skills", {
|
fetch(registry + "/api/v1/skills", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { Authorization: "Bearer " + token },
|
headers: { Authorization: "Bearer " + token },
|
||||||
body: form,
|
body: form,
|
||||||
}).then(async r => {
|
}).then(async (r) => {
|
||||||
const text = await r.text();
|
const text = await r.text();
|
||||||
if (!r.ok) { console.error("Publish failed:", r.status, text); process.exit(1); }
|
if (!r.ok) {
|
||||||
|
console.error("Publish failed:", r.status, text);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
console.log("✔ Published", slug + "@" + version);
|
console.log("✔ Published", slug + "@" + version);
|
||||||
}).catch(e => { console.error(e); process.exit(1); });
|
}).catch((e) => {
|
||||||
|
console.error(e);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
PUBLISH_SCRIPT
|
PUBLISH_SCRIPT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user