Merge pull request #48 from modelcontextprotocol/justin/auto-publish-npm

Publish releases publicly to npm
This commit is contained in:
Justin Spahr-Summers 2024-11-11 15:45:07 +00:00 • committed by GitHub
commit 2cc496dfe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 10 deletions

View file

@ -4,7 +4,7 @@ on:
- main
pull_request:
release:
types: [created]
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -26,13 +26,14 @@ jobs:
- run: npm test
- run: npm run lint
package:
publish:
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: build
permissions:
contents: write
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
@ -40,12 +41,9 @@ jobs:
with:
node-version: 18
cache: npm
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm pack
- name: Upload package to release
- run: npm publish --provenance --access public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} ./*.tgz
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View file

@ -1,6 +1,6 @@
{
"name": "@modelcontextprotocol/sdk",
"version": "0.3.3",
"version": "0.4.0",
"description": "Model Context Protocol implementation for TypeScript",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",