Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

fix(ci): handle npm prerelease publish across Node.js CD workflows (#4690)

Saket Aryan0daa5d7d034e
diff --git a/.github/workflows/cli-node-cd.yml b/.github/workflows/cli-node-cd.yml
index 9190bf661..113de7b1c 100644
--- a/.github/workflows/cli-node-cd.yml
+++ b/.github/workflows/cli-node-cd.yml
@@ -40,4 +40,10 @@ jobs:
run: pnpm run build
- name: Publish to npm
- run: npm publish --provenance --access public
+ run: |
+ if [ "${{ github.event.release.prerelease }}" = "true" ]; then
+ PREID=$(node -p "require('./package.json').version.split('-')[1].split('.')[0]")
+ npm publish --provenance --access public --tag "$PREID"
+ else
+ npm publish --provenance --access public
+ fi
diff --git a/.github/workflows/openclaw-cd.yml b/.github/workflows/openclaw-cd.yml
index eaa26768b..9c60cb149 100644
--- a/.github/workflows/openclaw-cd.yml
+++ b/.github/workflows/openclaw-cd.yml
@@ -40,4 +40,10 @@ jobs:
run: pnpm build
- name: Publish to npm
- run: npm publish --provenance --access public
+ run: |
+ if [ "${{ github.event.release.prerelease }}" = "true" ]; then
+ PREID=$(node -p "require('./package.json').version.split('-')[1].split('.')[0]")
+ npm publish --provenance --access public --tag "$PREID"
+ else
+ npm publish --provenance --access public
+ fi
diff --git a/.github/workflows/ts-sdk-cd.yml b/.github/workflows/ts-sdk-cd.yml
index 74163a323..8d3f64343 100644
--- a/.github/workflows/ts-sdk-cd.yml
+++ b/.github/workflows/ts-sdk-cd.yml
@@ -40,4 +40,10 @@ jobs:
run: pnpm run build
- name: Publish to npm
- run: npm publish --provenance --access public
+ run: |
+ if [ "${{ github.event.release.prerelease }}" = "true" ]; then
+ PREID=$(node -p "require('./package.json').version.split('-')[1].split('.')[0]")
+ npm publish --provenance --access public --tag "$PREID"
+ else
+ npm publish --provenance --access public
+ fi
diff --git a/.github/workflows/vercel-ai-cd.yml b/.github/workflows/vercel-ai-cd.yml
index 6cc2a4995..168d9730e 100644
--- a/.github/workflows/vercel-ai-cd.yml
+++ b/.github/workflows/vercel-ai-cd.yml
@@ -40,4 +40,10 @@ jobs:
run: pnpm run build
- name: Publish to npm
- run: npm publish --provenance --access public
+ run: |
+ if [ "${{ github.event.release.prerelease }}" = "true" ]; then
+ PREID=$(node -p "require('./package.json').version.split('-')[1].split('.')[0]")
+ npm publish --provenance --access public --tag "$PREID"
+ else
+ npm publish --provenance --access public
+ fi