tidy(docs): fix erroneous paths in docs/guides/publishing/github-actions.md (#455)
Tidy docs & lint. Solves https://github.com/modelcontextprotocol/registry/issues/454
This commit is contained in:
parent
35d2bd50c4
commit
c6b8359e23
1 changed files with 42 additions and 40 deletions
|
|
@ -5,6 +5,7 @@ Set up automated MCP server publishing using GitHub Actions.
|
||||||
## What You'll Learn
|
## What You'll Learn
|
||||||
|
|
||||||
By the end of this tutorial, you'll have:
|
By the end of this tutorial, you'll have:
|
||||||
|
|
||||||
- A GitHub Actions workflow that automatically publishes your server
|
- A GitHub Actions workflow that automatically publishes your server
|
||||||
- Understanding of GitHub OIDC authentication
|
- Understanding of GitHub OIDC authentication
|
||||||
- Knowledge of best practices for automated publishing
|
- Knowledge of best practices for automated publishing
|
||||||
|
|
@ -28,24 +29,24 @@ name: Publish to MCP Registry
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ['v*'] # Triggers on version tags like v1.0.0
|
tags: ["v*"] # Triggers on version tags like v1.0.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write # Required for OIDC authentication
|
id-token: write # Required for OIDC authentication
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js # Adjust for your language
|
- name: Setup Node.js # Adjust for your language
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: "20"
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
@ -67,7 +68,7 @@ jobs:
|
||||||
git clone https://github.com/modelcontextprotocol/registry publisher-repo
|
git clone https://github.com/modelcontextprotocol/registry publisher-repo
|
||||||
cd publisher-repo
|
cd publisher-repo
|
||||||
make publisher
|
make publisher
|
||||||
cp cmd/publisher/bin/mcp-publisher ../mcp-publisher
|
cp bin/mcp-publisher ../mcp-publisher
|
||||||
cd ..
|
cd ..
|
||||||
chmod +x mcp-publisher
|
chmod +x mcp-publisher
|
||||||
|
|
||||||
|
|
@ -97,6 +98,7 @@ git push origin v1.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
The workflow will:
|
The workflow will:
|
||||||
|
|
||||||
1. Run tests
|
1. Run tests
|
||||||
2. Build your package
|
2. Build your package
|
||||||
3. Publish to npm
|
3. Publish to npm
|
||||||
|
|
@ -113,6 +115,7 @@ The workflow will:
|
||||||
```
|
```
|
||||||
|
|
||||||
**Advantages:**
|
**Advantages:**
|
||||||
|
|
||||||
- No secrets to manage
|
- No secrets to manage
|
||||||
- Automatically scoped to your repository
|
- Automatically scoped to your repository
|
||||||
- Most secure option
|
- Most secure option
|
||||||
|
|
@ -150,7 +153,7 @@ name: Publish Python MCP Server
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ['v*']
|
tags: ["v*"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
|
|
@ -165,7 +168,7 @@ jobs:
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: "3.11"
|
||||||
|
|
||||||
- name: Install Poetry
|
- name: Install Poetry
|
||||||
run: pipx install poetry
|
run: pipx install poetry
|
||||||
|
|
@ -182,7 +185,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/modelcontextprotocol/registry publisher-repo
|
git clone https://github.com/modelcontextprotocol/registry publisher-repo
|
||||||
cd publisher-repo && make publisher && cd ..
|
cd publisher-repo && make publisher && cd ..
|
||||||
cp publisher-repo/cmd/publisher/bin/mcp-publisher mcp-publisher
|
cp publisher-repo/bin/mcp-publisher mcp-publisher
|
||||||
|
|
||||||
- name: Publish to MCP Registry
|
- name: Publish to MCP Registry
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -197,7 +200,7 @@ name: Publish Docker MCP Server
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ['v*']
|
tags: ["v*"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
|
|
@ -235,7 +238,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/modelcontextprotocol/registry publisher-repo
|
git clone https://github.com/modelcontextprotocol/registry publisher-repo
|
||||||
cd publisher-repo && make publisher && cd ..
|
cd publisher-repo && make publisher && cd ..
|
||||||
cp publisher-repo/cmd/publisher/bin/mcp-publisher mcp-publisher
|
cp publisher-repo/bin/mcp-publisher mcp-publisher
|
||||||
|
|
||||||
- name: Publish to MCP Registry
|
- name: Publish to MCP Registry
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -243,7 +246,6 @@ jobs:
|
||||||
./mcp-publisher publish
|
./mcp-publisher publish
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Best Practices
|
## Best Practices
|
||||||
|
|
||||||
### 1. Version Alignment
|
### 1. Version Alignment
|
||||||
|
|
@ -272,7 +274,6 @@ Only publish to registry after package publishing succeeds:
|
||||||
run: ./mcp-publisher publish
|
run: ./mcp-publisher publish
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
**"Publisher binary not found"** - Ensure you download the correct binary for your CI platform (linux/mac/windows).
|
**"Publisher binary not found"** - Ensure you download the correct binary for your CI platform (linux/mac/windows).
|
||||||
|
|
@ -286,6 +287,7 @@ Only publish to registry after package publishing succeeds:
|
||||||
## What You've Accomplished
|
## What You've Accomplished
|
||||||
|
|
||||||
You now have automated MCP server publishing that:
|
You now have automated MCP server publishing that:
|
||||||
|
|
||||||
- Triggers on version tags
|
- Triggers on version tags
|
||||||
- Runs tests before publishing
|
- Runs tests before publishing
|
||||||
- Publishes to package registry first
|
- Publishes to package registry first
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue