Skip to content

Commit af5da40

Browse files
feat: add GitHub Actions workflow for publishing to npm and MCP Registry
1 parent da9f28c commit af5da40

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write # required for github-oidc login
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: Install & build
24+
run: npm ci && npm run build
25+
26+
- name: Publish to npm
27+
run: npm publish --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
31+
- name: Install mcp-publisher
32+
run: |
33+
curl -fsSL "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" \
34+
| tar xz mcp-publisher
35+
36+
- name: Login to MCP Registry
37+
run: ./mcp-publisher login github-oidc
38+
39+
- name: Publish to MCP Registry
40+
run: ./mcp-publisher publish

0 commit comments

Comments
 (0)