forked from workpnp-com/agentic-guardrails
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 2.89 KB
/
Copy pathnpm-publish.yml
File metadata and controls
88 lines (75 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Publish npm Packages
on:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
# ─── Publish @openguardrails/moltguard (OpenClaw plugin) ──
publish-moltguard:
name: Publish @openguardrails/moltguard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build Gateway
working-directory: gateway
run: |
npm install
npm run build
- name: Bundle Gateway into MoltGuard
run: |
rm -rf moltguard/gateway
mkdir -p moltguard/gateway/handlers
cp gateway/dist/*.js gateway/dist/*.d.ts gateway/dist/*.map moltguard/gateway/
cp gateway/dist/handlers/*.js gateway/dist/handlers/*.d.ts gateway/dist/handlers/*.map moltguard/gateway/handlers/
- name: Build Dashboard
working-directory: dashboard
run: |
pnpm install
pnpm build
cd apps/api && pnpm bundle
- name: Bundle Dashboard into MoltGuard
run: |
mkdir -p moltguard/dashboard-dist/api
mkdir -p moltguard/dashboard-dist/web
cp -r dashboard/apps/api/bundle/* moltguard/dashboard-dist/api/
cp -r dashboard/apps/web/out/* moltguard/dashboard-dist/web/
- name: Build moltguard
working-directory: moltguard
run: |
npm install
npm run build
- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken "$NODE_AUTH_TOKEN"
cd moltguard && npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# ─── Release summary ──────────────────────────────────────────
summary:
name: Release Summary
runs-on: ubuntu-latest
needs: [publish-moltguard]
if: always()
steps:
- uses: actions/checkout@v4
- name: Create summary
run: |
VERSION=$(jq -r '.version' moltguard/package.json)
echo "## npm Packages Published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Package | Version | Status |" >> $GITHUB_STEP_SUMMARY
echo "|---------|---------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| \`@openguardrails/moltguard\` | ${VERSION} | ${{ needs.publish-moltguard.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Install" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "# Install MoltGuard plugin for OpenClaw" >> $GITHUB_STEP_SUMMARY
echo "claw plugin install @openguardrails/moltguard" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY