Skip to content

Commit bf1231a

Browse files
committed
ci: add GitHub Release + MCP Registry publish to workflow
Adds version-already-published check, GitHub Release creation, and mcp-publisher OIDC auth for Official MCP Registry.
1 parent 9b40d1d commit bf1231a

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
name: Publish to npm
1+
name: Publish
22
on:
33
push:
44
tags:
55
- 'v*'
66
jobs:
77
publish:
88
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write
11+
contents: write
912
steps:
1013
- uses: actions/checkout@v5
1114
- uses: actions/setup-node@v5
@@ -21,14 +24,24 @@ jobs:
2124
PUBLISHED=$(npm view "$PKG_NAME@$PKG_VER" version 2>/dev/null || echo "")
2225
if [ "$PUBLISHED" = "$PKG_VER" ]; then
2326
echo "skip=true" >> $GITHUB_OUTPUT
24-
echo "Version $PKG_VER already published, skipping."
2527
else
2628
echo "skip=false" >> $GITHUB_OUTPUT
2729
fi
2830
env:
2931
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30-
- run: npm publish --access public
32+
- name: Publish to npm
3133
if: steps.check.outputs.skip != 'true'
32-
continue-on-error: true
34+
run: npm publish --access public
3335
env:
3436
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
- name: Create GitHub Release
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
generate_release_notes: true
41+
- name: Install mcp-publisher
42+
run: |
43+
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
44+
- name: Authenticate to MCP Registry (OIDC)
45+
run: ./mcp-publisher login github-oidc
46+
- name: Publish to MCP Registry
47+
run: ./mcp-publisher publish

0 commit comments

Comments
 (0)