Skip to content

chore(main): release 0.2.1 (#7) #18

chore(main): release 0.2.1 (#7)

chore(main): release 0.2.1 (#7) #18

Workflow file for this run

name: Release
on:
push:
branches: [main]
workflow_dispatch:
inputs:
tag:
description: 'Existing release tag to publish (e.g. v0.1.3). Used when a previous publish failed.'
required: true
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release-please:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
publish:
needs: release-please
if: ${{ always() && (needs.release-please.outputs.release_created == 'true' || github.event_name == 'workflow_dispatch') }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || needs.release-please.outputs.tag_name }}
- uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run build
# Trusted Publisher OIDC needs npm >= 11.5.1. Node 22's bundled npm
# is 10.x, and `npm install -g npm@latest` is currently broken on
# 22.22.2 (missing 'promise-retry'). Use npx to invoke a known-good
# npm version just for the publish step.
- run: npx -y npm@11.5.2 publish --provenance --access public
# Sync server.json's version to the released tag and republish to the
# MCP Registry. Authenticates via GitHub OIDC — same security model as
# npm Trusted Publisher; no secret token needed.
- name: Sync server.json version to released tag
env:
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || needs.release-please.outputs.tag_name }}
run: |
set -euo pipefail
VERSION="${TAG#v}"
jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.tmp
mv server.tmp server.json
echo "server.json now at version $VERSION"
- name: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
- name: Authenticate to MCP Registry (GitHub OIDC)
run: ./mcp-publisher login github-oidc
- name: Publish to MCP Registry
run: ./mcp-publisher publish