File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Release npm package
2+
3+ # Auto-publish the OpenClaw plugin (@cortex-ai-memory/cortex-memory) to npm on every
4+ # version tag, so npm never lags a release. Requires the NPM_TOKEN repo secret
5+ # (an npm automation token with publish rights to the @cortex-ai-memory scope).
6+ on :
7+ push :
8+ tags : ['v*']
9+ workflow_dispatch :
10+
11+ permissions :
12+ contents : read
13+
14+ jobs :
15+ publish :
16+ name : Publish to npm
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+ - uses : actions/setup-node@v4
21+ with :
22+ node-version : ' 20'
23+ registry-url : ' https://registry.npmjs.org'
24+ - name : Guard — package version must match the tag
25+ run : |
26+ TAG="${GITHUB_REF_NAME#v}"
27+ PKG=$(node -p "require('./openclaw-plugin/package.json').version")
28+ if [ "$TAG" != "$PKG" ]; then
29+ echo "::error::tag $TAG != openclaw-plugin version $PKG — bump the manifest"
30+ exit 1
31+ fi
32+ - name : Build & publish
33+ working-directory : openclaw-plugin
34+ run : |
35+ npm install
36+ npm run build
37+ npm publish --access public
38+ env :
39+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments