name: Publish to MCP registry # Manual recovery workflow. The primary release path is release.yml # (triggered by a v* tag push). Use this only to re-run the MCP registry # publish in isolation when the main pipeline has partially failed, or to # publish a server.json fix that landed after the tag. # # Checks out the default branch (not the tag) so a server.json fix on main is # picked up; the release version is stamped in from the tag input. Auth is # GitHub OIDC, so no token is needed. on: workflow_dispatch: inputs: tag: description: "Release tag to publish (e.g. v0.11.2)" required: true type: string concurrency: group: mcp-publish-${{ inputs.tag }} cancel-in-progress: false permissions: id-token: write contents: read jobs: publish: name: Publish to MCP registry runs-on: ubuntu-latest # Manual dispatch publishes to the MCP registry exactly as a tagged release does, # so it takes the same approval gate. Without this the recovery path is a # way to publish with no review. environment: production-publish timeout-minutes: 15 steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: node-version: "24" - name: Determine version id: version env: INPUT_TAG: ${{ inputs.tag }} run: | TAG="$INPUT_TAG" VERSION="${TAG#v}" # Same shape rule as release.yml, homebrew.yml and npm.yml, from the # same script. if [ "$VERSION" = "$TAG" ] || ! scripts/is-semver.sh "$VERSION"; then echo "::error::Invalid tag format: $TAG (expected vX.Y.Z)" exit 1 fi # The release skips the registry for a prerelease, so recovery does # too. The registry marks whichever version is highest by semver as # latest, and 1.3.0-rc.1 sorts above 1.2.1. PRERELEASE=$(scripts/is-prerelease.sh "$VERSION") if [ "$PRERELEASE" = true ]; then echo "::error::$TAG is a prerelease. The MCP registry only carries stable releases." exit 1 fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "Publishing version: $VERSION (tag: $TAG)" # The registry verifies ownership against the live npm package, so make # sure this version is on npm before publishing the registry entry. - name: Wait for npm package to go live env: VERSION: ${{ steps.version.outputs.version }} run: | for i in $(seq 1 60); do if npm view "dynoxide@$VERSION" version >/dev/null 2>&1; then echo "dynoxide@$VERSION is live on npm" exit 0 fi echo "Waiting for dynoxide@$VERSION on npm ($i/60)..." sleep 10 done echo "::error::dynoxide@$VERSION did not appear on npm within 10 minutes" exit 1 - name: Install mcp-publisher run: scripts/install-mcp-publisher.sh - name: Stamp release version into server.json env: VERSION: ${{ steps.version.outputs.version }} run: | jq --arg v "$VERSION" ' .version = $v | (.packages[] | select(.registryType == "npm")).version = $v | (.packages[] | select(.registryType == "oci")).identifier = "ghcr.io/nubo-db/dynoxide:\($v)" ' server.json > server.json.tmp mv server.json.tmp server.json cat server.json - name: Authenticate to the MCP registry via GitHub OIDC run: ./mcp-publisher login github-oidc - name: Publish server.json run: ./mcp-publisher publish