Skip to content

Commit

Permalink
Add publishing to npm using github actions
Browse files Browse the repository at this point in the history
---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/michaellatman/mcp-get?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
michaellatman committed Nov 27, 2024
1 parent 7d32006 commit 553a1cc
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 553a1cc

Please sign in to comment.