Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

ci(mcp): publish to npm automatically on version bump

Andrej9eb0b81201c5
diff --git a/.github/workflows/publish-mcp.yml b/.github/workflows/publish-mcp.yml
index b60fc3b9c..d3249e847 100644
--- a/.github/workflows/publish-mcp.yml
+++ b/.github/workflows/publish-mcp.yml
@@ -3,19 +3,29 @@ name: Publish MCP Package
on:
release:
types: [published]
+ push:
+ branches: [main]
+ paths:
+ - packages/mcp/package.json
permissions:
- contents: read
+ contents: write
id-token: write
+concurrency:
+ group: publish-mcp
+ cancel-in-progress: false
+
jobs:
publish:
runs-on: ubuntu-24.04
- if: ${{ startsWith(github.event.release.tag_name, 'mcp-v') }}
+ if: ${{ github.event_name == 'push' || startsWith(github.event.release.tag_name, 'mcp-v') }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
+ with:
+ persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@v6
@@ -38,6 +48,7 @@ jobs:
pnpm --filter @kaneo/mcp build
- name: Validate MCP release tag
+ if: ${{ github.event_name == 'release' }}
run: |
PACKAGE_VERSION=$(node -p "require('./packages/mcp/package.json').version")
TAG_VERSION="${GITHUB_REF_NAME#mcp-v}"
@@ -71,3 +82,21 @@ jobs:
npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+ - name: Create MCP release
+ if: ${{ github.event_name == 'push' }}
+ run: |
+ PACKAGE_VERSION=$(node -p "require('./packages/mcp/package.json').version")
+
+ if gh release view "mcp-v${PACKAGE_VERSION}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
+ echo "Release mcp-v${PACKAGE_VERSION} already exists; skipping."
+ exit 0
+ fi
+
+ gh release create "mcp-v${PACKAGE_VERSION}" \
+ --target "${GITHUB_SHA}" \
+ --title "@kaneo/mcp v${PACKAGE_VERSION}" \
+ --notes "Published [@kaneo/mcp@${PACKAGE_VERSION}](https://www.npmjs.com/package/@kaneo/mcp/v/${PACKAGE_VERSION}) to npm." \
+ --latest=false
+ env:
+ GH_TOKEN: ${{ github.token }}
diff --git a/packages/mcp/README.md b/packages/mcp/README.md
index 358e66bbe..972428e87 100644
--- a/packages/mcp/README.md
+++ b/packages/mcp/README.md
@@ -121,3 +121,9 @@ For headless or sandboxed environments where opening a browser is impractical, s
- Comments: `list_task_comments`, `create_task_comment`, `update_task_comment`, `delete_task_comment`
- Labels: `list_workspace_labels`, `create_label`, `attach_label_to_task`, `detach_label_from_task`, `delete_label`
- Task relations: `create_task_relation`, `get_task_relations`, `delete_task_relation`
+
+## Releasing
+
+Bump `version` in `packages/mcp/package.json` and merge to `main`. The [publish workflow](../../.github/workflows/publish-mcp.yml) runs the package tests, publishes the new version to npm, and creates a `mcp-v<version>` GitHub release. Nothing is published while the version stays the same, so tool changes reach npm only once the version is bumped.
+
+Publishing a GitHub release manually also works: tag it `mcp-v<version>` with the tag version matching `packages/mcp/package.json` on the tagged commit.