Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Publish Package

# Publishes @agentage/mcp-memory to npm. Manual (workflow_dispatch) or on a release
# commit to master; never on an ordinary push. Requires an NPM_TOKEN repo secret.
# (The first publish was bootstrapped manually; --provenance is safe now the pkg exists.)

on:
push:
branches: [master]
paths:
- 'package.json'
workflow_dispatch:

permissions:
contents: write
id-token: write

env:
NODE_VERSION: '22'

jobs:
release-gate:
name: Release gate
runs-on: ubuntu-latest
outputs:
is-release: ${{ steps.check.outputs.is-release }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 5
- id: check
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "is-release=true" >> "$GITHUB_OUTPUT"; exit 0
fi
MSG=$(git log -1 --pretty=%s)
if echo "$MSG" | grep -qE "(^Release v|^chore: prepare release|^chore\(release\))"; then
echo "is-release=true" >> "$GITHUB_OUTPUT"
else
echo "is-release=false" >> "$GITHUB_OUTPUT"
echo "Not a release commit - skipping publish."
fi

publish:
name: Publish to npm
needs: [release-gate]
if: needs.release-gate.outputs.is-release == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- name: Skip if version already on npm
id: ver
run: |
name=$(node -p "require('./package.json').name")
version=$(node -p "require('./package.json').version")
if npm view "${name}@${version}" version >/dev/null 2>&1; then
echo "publish=false" >> "$GITHUB_OUTPUT"
echo "${name}@${version} already published."
else
echo "publish=true" >> "$GITHUB_OUTPUT"
fi
echo "tag=v${version}" >> "$GITHUB_OUTPUT"
- if: steps.ver.outputs.publish == 'true'
run: npm run verify
- if: steps.ver.outputs.publish == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public --provenance
- if: steps.ver.outputs.publish == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.ver.outputs.tag }}" -m "Release ${{ steps.ver.outputs.tag }}"
git push origin "${{ steps.ver.outputs.tag }}"
47 changes: 25 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"description": "The MCP server for agentage Memory: exposes @agentage/memory-core vaults as the frozen 6 memory__* tools over stdio. The open, cross-vendor counterpart to @modelcontextprotocol/server-memory.",
"type": "module",
"license": "UNLICENSED",
"private": true,
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": "./dist/index.js"
},
"publishConfig": {
"access": "public"
},
"bin": {
"agentage-mcp-memory": "dist/bin/mcp-memory.js"
},
Expand All @@ -35,7 +37,7 @@
"prepublishOnly": "npm run verify"
},
"dependencies": {
"@agentage/memory-core": "file:../memory-core",
"@agentage/memory-core": "^0.0.1",
"@modelcontextprotocol/sdk": "^1.29.0",
"zod": "^4.4.3"
},
Expand Down