Skip to content

Commit 18dea95

Browse files
Add NPM publish workflow
1 parent cb2c79a commit 18dea95

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
id-token: write
11+
steps:
12+
- uses: actions/checkout@v5
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.x'
18+
registry-url: 'https://registry.npmjs.org'
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Sync version with release tag
24+
# Updates package.json to the release tag version (e.g., v1.2.3)
25+
run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
26+
27+
- name: Build package
28+
run: npm run build
29+
30+
- name: Publish to npmjs
31+
# No NODE_AUTH_TOKEN needed; setup-node handles OIDC auth
32+
run: npm publish --access public

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
"inspect": "set DANGEROUSLY_OMIT_AUTH=true && CLIENT_PORT=8090 SERVER_PORT=9000 npx @modelcontextprotocol/inspector npm run dev",
1818
"test": "mocha"
1919
},
20-
"files": [
21-
"build"
22-
],
20+
"files": [ "build", "README.md" ],
2321
"keywords": [
2422
"paystack",
2523
"mcp",

0 commit comments

Comments
 (0)