Skip to content

Commit

Permalink
Merge pull request #2 from michaellatman/add-publishing
Browse files Browse the repository at this point in the history
Add publishing to npm using github actions
  • Loading branch information
michaellatman authored Nov 27, 2024
2 parents 7d32006 + 553a1cc commit ac2259e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to npm

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"start": "node dist/index.js"
"start": "node dist/index.js",
"publish": "npm publish"
},
"bin": {
"mcp-get": "dist/index.js"
Expand All @@ -15,5 +16,10 @@
},
"devDependencies": {
"@types/node": "^14.0.0"
}
},
"files": [
"dist",
"README.md",
"package.json"
]
}

0 comments on commit ac2259e

Please sign in to comment.