Skip to content

Commit bb521ba

Browse files
committed
build: bundle dependencies and add release-bundle workflow
Add bundleDependencies (@earendil-works/pi-coding-agent, mermaid) so npm pack produces a self-contained tarball, and a GitHub Actions workflow that builds, sanity-checks and publishes elestio-pi-webui-<VER>-bundled.tgz on every v* tag. This is the fast-path install asset consumed by elestio-backend-api (extracted with raw tar instead of npm install on client VMs).
1 parent 258ee4a commit bb521ba

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release-bundle
2+
on:
3+
push:
4+
tags: ['v*']
5+
permissions:
6+
contents: write
7+
jobs:
8+
bundle:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with: { node-version: 22 }
14+
- run: npm install --ignore-scripts --omit=dev --no-audit --no-fund
15+
- run: npm pack
16+
- name: Rename to backend contract
17+
run: |
18+
VER=$(node -p "require('./package.json').version")
19+
[ "v$VER" = "$GITHUB_REF_NAME" ] || { echo "tag $GITHUB_REF_NAME != package version $VER"; exit 1; }
20+
mv elestio-pi-webui-$VER.tgz elestio-pi-webui-$VER-bundled.tgz
21+
- name: Sanity check the asset
22+
run: |
23+
VER=$(node -p "require('./package.json').version")
24+
mkdir /tmp/check && tar -xzf elestio-pi-webui-$VER-bundled.tgz -C /tmp/check
25+
[ "$(node -p "require('/tmp/check/package/package.json').version")" = "$VER" ]
26+
head -1 /tmp/check/package/bin/pi-webui.mjs | grep -q '#!/usr/bin/env node'
27+
node /tmp/check/package/node_modules/@earendil-works/pi-coding-agent/dist/cli.js --version
28+
- uses: softprops/action-gh-release@v2
29+
with:
30+
files: elestio-pi-webui-*-bundled.tgz

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
"@earendil-works/pi-coding-agent": "0.80.2",
3535
"mermaid": "^11.15.0"
3636
},
37+
"bundleDependencies": [
38+
"@earendil-works/pi-coding-agent",
39+
"mermaid"
40+
],
3741
"files": [
3842
"index.ts",
3943
"lib",

0 commit comments

Comments
 (0)