Skip to content

Commit d6e9385

Browse files
committed
added github action
1 parent 461b76e commit d6e9385

3 files changed

Lines changed: 52 additions & 1 deletion

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish NPM Package
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to release (leave empty to use current package.json version)"
8+
required: false
9+
type: string
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
- uses: pnpm/action-setup@v2
20+
with:
21+
version: 9
22+
- run: pnpm install --frozen-lockfile
23+
- run: pnpm run typecheck
24+
- run: pnpm test
25+
26+
publish-npm:
27+
needs: test
28+
runs-on: ubuntu-latest
29+
environment: prod
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
registry-url: https://registry.npmjs.org/
36+
- uses: pnpm/action-setup@v2
37+
with:
38+
version: 9
39+
- name: Set version if specified
40+
if: ${{ github.event.inputs.version != '' }}
41+
run: pnpm version ${{ github.event.inputs.version }} --no-git-tag-version
42+
- run: pnpm install --frozen-lockfile
43+
- name: Publish release
44+
run: pnpm run release
45+
env:
46+
NODE_AUTH_TOKEN: ${{secrets.IRON_NPM_PUBLISHING_TOKEN}}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"test": "vitest run",
1313
"test:watch": "vitest",
1414
"test:coverage": "vitest run --coverage",
15+
"typecheck": "tsc --noEmit",
16+
"release": "pnpm run build && pnpm publish --access public",
1517
"prepublishOnly": "pnpm run build && pnpm run test"
1618
},
1719
"dependencies": {
@@ -58,5 +60,8 @@
5860
"homepage": "https://iron.xyz",
5961
"bugs": {
6062
"url": "https://github.com/ironxyz/mcp-server/issues"
63+
},
64+
"publishConfig": {
65+
"access": "public"
6166
}
6267
}

publish.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
4. **Publish to npm:**
4040

4141
```bash
42-
pnpm publish
42+
pnpm run release
4343
```
4444

4545
5. **Push git changes:**

0 commit comments

Comments
 (0)