release: v0.4.2 (#47) #12
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release | |
| # Automated release pipeline for @mnemoverse/mcp-memory-server. | |
| # | |
| # Trigger: push a semver tag `vX.Y.Z` to main (e.g. `git tag v0.3.2 && git push origin v0.3.2`). | |
| # | |
| # What this workflow does, in order: | |
| # 1. Checks that the tag's version matches package.json#version (catches "forgot to bump" mistakes). | |
| # 2. npm ci + npm run build (prebuild regenerates every generated artifact from source.json). | |
| # 3. npm run verify:configs — drift check, fails fast if anything is out of sync with source.json. | |
| # 4. npm publish — uses a repo-scoped automation token stored in the NPM_TOKEN secret. | |
| # 5. Installs mcp-publisher CLI (Linux amd64 bottle from the releases bucket). | |
| # 6. mcp-publisher login github-oidc — uses GitHub Actions' OIDC token, NO stored PAT. | |
| # 7. mcp-publisher publish — uploads the freshly-generated server.json to registry.modelcontextprotocol.io. | |
| # 8. gh release create — posts a GitHub release with auto-generated notes. | |
| # | |
| # Why OIDC instead of a PAT: | |
| # The GitHub OIDC provider issues a short-lived JWT that the MCP Registry trusts on the basis | |
| # of the repo's owner (mnemoverse) and branch/tag claim. No long-lived secret sits in the repo. | |
| # Prereq: `permissions: id-token: write` on the job, and the authenticating user's org | |
| # membership (izgorodin in mnemoverse) must be public — already done. | |
| # | |
| # Prerequisite secrets you must add at repo Settings > Secrets and variables > Actions: | |
| # - NPM_TOKEN — npm automation token from npmjs.com/settings/{org}/tokens/granular-access-tokens/new | |
| # (select "Automation", grant publish access to @mnemoverse/mcp-memory-server). | |
| # | |
| # To release: | |
| # 1. Bump version in package.json + src/index.ts on main (keep them in sync). | |
| # 2. `npm run generate:configs` to propagate the new version to server.json. | |
| # 3. Commit, push to main (through PR, drift CI passes). | |
| # 4. `git tag v$(node -p "require('./package.json').version")`. | |
| # 5. `git push origin v0.x.y`. | |
| # The workflow does the rest. | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to release (e.g. v0.3.2). Must already exist." | |
| required: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # contents:write — needed to create the GitHub release. | |
| # id-token:write — required by `mcp-publisher login github-oidc`. | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout tag | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.tag || github.ref }} | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Verify tag matches package.json#version | |
| run: | | |
| set -euo pipefail | |
| TAG="${{ github.event.inputs.tag || github.ref_name }}" | |
| TAG_VERSION="${TAG#v}" | |
| PKG_VERSION="$(node -p "require('./package.json').version")" | |
| echo "tag: $TAG" | |
| echo "tag version: $TAG_VERSION" | |
| echo "pkg version: $PKG_VERSION" | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "::error::Tag $TAG (version $TAG_VERSION) does not match package.json version $PKG_VERSION" | |
| exit 1 | |
| fi | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build (runs generate:configs via prebuild) | |
| run: npm run build | |
| - name: Verify no drift between source.json and generated artifacts | |
| run: npm run verify:configs | |
| - name: Publish to npm | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Install mcp-publisher CLI | |
| run: | | |
| set -euo pipefail | |
| curl -sSL \ | |
| "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" \ | |
| | tar xz mcp-publisher | |
| ./mcp-publisher --help | |
| - name: Authenticate with MCP Registry via GitHub OIDC | |
| run: ./mcp-publisher login github-oidc | |
| - name: Publish to Official MCP Registry | |
| run: ./mcp-publisher publish | |
| - name: Verify the registry entry shows the new version | |
| run: | | |
| set -euo pipefail | |
| TAG="${{ github.event.inputs.tag || github.ref_name }}" | |
| VERSION="${TAG#v}" | |
| echo "Waiting a few seconds for the registry to propagate..." | |
| sleep 3 | |
| RESULT="$(curl -sS "https://registry.modelcontextprotocol.io/v0.1/servers/io.github.mnemoverse%2Fmcp-memory-server/versions/$VERSION")" | |
| echo "$RESULT" | python3 -m json.tool | |
| echo "$RESULT" | python3 -c " | |
| import sys, json | |
| d = json.load(sys.stdin) | |
| srv = d['server'] | |
| assert srv['version'] == '$VERSION', f\"registry version {srv['version']} != $VERSION\" | |
| print(f'✓ Registry shows {srv[\"name\"]}@{srv[\"version\"]}') | |
| " | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag || github.ref_name }} | |
| name: ${{ github.event.inputs.tag || github.ref_name }} | |
| generate_release_notes: true | |
| body: | | |
| Published via automated release pipeline (`.github/workflows/release.yml`). | |
| - npm: https://www.npmjs.com/package/@mnemoverse/mcp-memory-server | |
| - MCP Registry: https://registry.modelcontextprotocol.io/v0.1/servers?search=mnemoverse | |
| Full changelog below. |