diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8005819 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/package.json b/package.json index e1a60cb..8ad08fb 100644 --- a/package.json +++ b/package.json @@ -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" @@ -15,5 +16,10 @@ }, "devDependencies": { "@types/node": "^14.0.0" - } + }, + "files": [ + "dist", + "README.md", + "package.json" + ] }