Skip to content

Commit 3ad0539

Browse files
Merge pull request #98 from comet-ml/fix/clawhub-publish-build-dist
ci(clawhub): build runtime before publish so dist/ ships in archive
2 parents 0f62b10 + 48afa61 commit 3ad0539

2 files changed

Lines changed: 60 additions & 15 deletions

File tree

.github/workflows/clawhub-package-publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ jobs:
8888
with:
8989
ref: ${{ github.sha }}
9090

91+
# ClawHub's package publish packs whatever exists on disk; it does not
92+
# honor npm's prepack hook. Build the package here so runtime entries
93+
# like dist/index.js are present in the published archive.
94+
- name: Setup Node.js
95+
if: hashFiles('package.json') != ''
96+
uses: actions/setup-node@v6
97+
with:
98+
node-version: "22.14.0"
99+
100+
- name: Build package runtime
101+
if: hashFiles('package.json') != ''
102+
shell: bash
103+
run: |
104+
if jq -e '.scripts.build' package.json >/dev/null 2>&1; then
105+
npm ci --no-audit --no-fund
106+
npm run build
107+
else
108+
echo "No build script in package.json; skipping build step."
109+
fi
110+
91111
- uses: oven-sh/setup-bun@e3914758a49697077f7bcd190d36582a61667aad
92112
with:
93113
bun-version: 1.3.10

package-lock.json

Lines changed: 40 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)