@@ -10,6 +10,36 @@ permissions:
1010 contents : read
1111
1212jobs :
13+ prettier-fix :
14+ name : Auto-fix formatting
15+ if : github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
16+ runs-on : ubuntu-latest
17+ permissions :
18+ contents : write
19+ steps :
20+ - uses : actions/checkout@v6
21+ with :
22+ ref : ${{ github.head_ref }}
23+ token : ${{ github.token }}
24+
25+ - uses : actions/setup-node@v6
26+ with :
27+ node-version : " 22"
28+ cache : npm
29+
30+ - run : npm ci
31+
32+ - run : npm run prettier:fix
33+
34+ - name : Commit formatting changes
35+ run : |
36+ git diff --quiet && exit 0
37+ git config user.name "github-actions[bot]"
38+ git config user.email "github-actions[bot]@users.noreply.github.com"
39+ git add -A
40+ git commit -m "style: auto-fix prettier formatting"
41+ git push
42+
1343 build :
1444 strategy :
1545 fail-fast : false
3060 runs-on : ${{ matrix.os }}
3161
3262 steps :
33- - uses : actions/checkout@v4
63+ - uses : actions/checkout@v6
3464
3565 - name : Verify no private URLs in package-lock.json
3666 shell : bash
@@ -40,14 +70,19 @@ jobs:
4070 shell : bash
4171 run : node scripts/check-versions.mjs
4272
43- - uses : actions/setup-node@v4
73+ - uses : actions/setup-node@v6
4474 with :
45- node-version : " 20"
75+ node-version : " 22"
76+ cache : npm
4677
47- - run : npm install
78+ - run : npm ci
4879
4980 - run : npm run build
5081
82+ - name : Validate TypeDoc links
83+ if : runner.os == 'Linux' && matrix.name == 'Linux x64'
84+ run : npm exec typedoc -- --treatValidationWarningsAsErrors --emit none
85+
5186 - run : npm run examples:build
5287
5388 - name : Verify generated schemas are up-to-date
@@ -66,20 +101,26 @@ jobs:
66101
67102 - run : npm run prettier
68103
104+ - name : Build MCPB bundle (pdf-server)
105+ if : runner.os == 'Linux' && matrix.name == 'Linux x64'
106+ run : npx -y @anthropic-ai/mcpb pack
107+ working-directory : examples/pdf-server
108+
69109 e2e :
70110 runs-on : ubuntu-latest
71111 steps :
72- - uses : actions/checkout@v4
112+ - uses : actions/checkout@v6
73113
74114 - uses : oven-sh/setup-bun@v2
75115 with :
76116 bun-version : latest
77117
78- - uses : actions/setup-node@v4
118+ - uses : actions/setup-node@v6
79119 with :
80- node-version : " 20"
120+ node-version : " 22"
121+ cache : npm
81122
82- - uses : astral-sh/setup-uv@v5
123+ - uses : astral-sh/setup-uv@v7
83124
84125 - run : npm ci
85126
90131 run : npx playwright test --reporter=list
91132
92133 - name : Upload test results
93- uses : actions/upload-artifact@v4
134+ uses : actions/upload-artifact@v6
94135 if : failure()
95136 with :
96137 name : test-results
@@ -103,23 +144,23 @@ jobs:
103144 runs-on : windows-latest
104145
105146 steps :
106- - uses : actions/checkout@v4
147+ - uses : actions/checkout@v6
107148
108- - uses : Vampire/setup-wsl@v5
149+ - uses : Vampire/setup-wsl@v6
109150 with :
110151 distribution : Ubuntu-24.04
111152
112153 - name : Install Node.js in WSL
113154 shell : wsl-bash {0}
114155 run : |
115156 sudo apt-get update
116- curl -fsSL https://deb.nodesource.com/setup_20 .x | sudo -E bash -
157+ curl -fsSL https://deb.nodesource.com/setup_22 .x | sudo -E bash -
117158 sudo apt-get install -y nodejs
118159
119160 - name : Build and test in WSL
120161 shell : wsl-bash {0}
121162 run : |
122- npm install
163+ npm ci
123164 npm run build
124165 npm run examples:build
125166 npm test
@@ -146,17 +187,20 @@ jobs:
146187 runs-on : ${{ matrix.os }}
147188
148189 steps :
149- - uses : actions/setup-node@v4
190+ - uses : actions/setup-node@v6
150191 with :
151- node-version : " 20 "
192+ node-version : " 22 "
152193
153194 - name : Create test project and install from git
154195 shell : bash
196+ env :
197+ HEAD_REPO : ${{ github.event.pull_request.head.repo.full_name || github.repository }}
198+ HEAD_REF : ${{ github.head_ref || github.ref_name }}
155199 run : |
156200 mkdir test-project
157201 cd test-project
158202 npm init -y
159203 # Install from the PR branch (use head repo for fork PRs)
160- npm install "git+https://github.com/${{ github.event.pull_request.head.repo.full_name || github.repository }} #${{ github.head_ref || github.ref_name } }"
204+ npm install "git+https://github.com/${HEAD_REPO} #${HEAD_REF }"
161205 # Verify the package is usable (ESM import)
162206 node --input-type=module -e "import { App } from '@modelcontextprotocol/ext-apps'; console.log('Import successful:', typeof App)"
0 commit comments