Skip to content

Commit 2cc496d

Browse files
Merge pull request #48 from modelcontextprotocol/justin/auto-publish-npm
Publish releases publicly to npm
2 parents 6164360 + acb96d9 commit 2cc496d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Diff for: .github/workflows/main.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
- main
55
pull_request:
66
release:
7-
types: [created]
7+
types: [published]
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
@@ -26,26 +26,24 @@ jobs:
2626
- run: npm test
2727
- run: npm run lint
2828

29-
package:
29+
publish:
3030
runs-on: ubuntu-latest
3131
if: github.event_name == 'release'
3232
needs: build
3333

3434
permissions:
35-
contents: write
35+
contents: read
36+
id-token: write
3637

3738
steps:
3839
- uses: actions/checkout@v4
3940
- uses: actions/setup-node@v4
4041
with:
4142
node-version: 18
4243
cache: npm
44+
registry-url: 'https://registry.npmjs.org'
4345

4446
- run: npm ci
45-
- run: npm pack
46-
47-
- name: Upload package to release
47+
- run: npm publish --provenance --access public
4848
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
run: |
51-
gh release upload ${{ github.event.release.tag_name }} ./*.tgz
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@modelcontextprotocol/sdk",
3-
"version": "0.3.3",
3+
"version": "0.4.0",
44
"description": "Model Context Protocol implementation for TypeScript",
55
"license": "MIT",
66
"author": "Anthropic, PBC (https://anthropic.com)",

0 commit comments

Comments
 (0)