1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
env:
# Opt every Node 20 action into Node 24 ahead of the June 2026 default flip
# and the September 2026 Node 20 removal.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
build:
name: Build - ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: aarch64-apple-darwin
os: macos-14
npm_dir: darwin-arm64
- target: x86_64-pc-windows-msvc
os: windows-latest
npm_dir: win32-x64
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Package binary for GitHub Release (Unix)
if: runner.os != 'Windows'
run: |
cd target/${{ matrix.target }}/release
tar -czvf ../../../native-devtools-mcp-${{ matrix.target }}.tar.gz native-devtools-mcp
- name: Package binary for GitHub Release (Windows)
if: runner.os == 'Windows'
run: |
cd target/${{ matrix.target }}/release
Compress-Archive -Path native-devtools-mcp.exe -DestinationPath ../../../native-devtools-mcp-${{ matrix.target }}.zip
shell: pwsh
- name: Prepare npm package (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p npm/${{ matrix.npm_dir }}/bin
cp target/${{ matrix.target }}/release/native-devtools-mcp npm/${{ matrix.npm_dir }}/bin/
chmod +x npm/${{ matrix.npm_dir }}/bin/native-devtools-mcp
- name: Prepare npm package (Windows)
if: runner.os == 'Windows'
run: |
New-Item -ItemType Directory -Force -Path npm/${{ matrix.npm_dir }}/bin
Copy-Item target/${{ matrix.target }}/release/native-devtools-mcp.exe npm/${{ matrix.npm_dir }}/bin/
shell: pwsh
- name: Upload GitHub Release artifact (Unix)
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: native-devtools-mcp-${{ matrix.target }}
path: native-devtools-mcp-${{ matrix.target }}.tar.gz
- name: Upload GitHub Release artifact (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: native-devtools-mcp-${{ matrix.target }}
path: native-devtools-mcp-${{ matrix.target }}.zip
- name: Upload npm package artifact
uses: actions/upload-artifact@v4
with:
name: npm-${{ matrix.npm_dir }}
path: npm/${{ matrix.npm_dir }}
build-macos-app:
name: Build macOS App (Signed + Notarized)
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Import signing certificate
env:
MACOS_SIGN_CERT_BASE64: ${{ secrets.MACOS_SIGN_CERT_BASE64 }}
MACOS_SIGN_CERT_PASSWORD: ${{ secrets.MACOS_SIGN_CERT_PASSWORD }}
run: |
# Decode certificate
echo "$MACOS_SIGN_CERT_BASE64" | base64 --decode > signing.p12
# Create temporary keychain
security create-keychain -p "temppass" build.keychain
security set-keychain-settings -lut 21600 build.keychain
security unlock-keychain -p "temppass" build.keychain
# Import certificate
security import signing.p12 -k build.keychain -P "$MACOS_SIGN_CERT_PASSWORD" -T /usr/bin/codesign
# Set key partition list (required for codesign to access the key)
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "temppass" build.keychain
# Add to search list
security list-keychains -d user -s build.keychain login.keychain
# Clean up
rm signing.p12
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build macOS app bundle
env:
TARGET: aarch64-apple-darwin
VERSION: ${{ steps.version.outputs.VERSION }}
SIGN_IDENTITY: ${{ secrets.MACOS_SIGN_IDENTITY }}
run: ./scripts/build-macos-app.sh
- name: Notarize and create DMG
env:
SIGN_IDENTITY: ${{ secrets.MACOS_SIGN_IDENTITY }}
NOTARY_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
NOTARY_API_ISSUER: ${{ secrets.APPSTORE_API_ISSUER_ID }}
APPSTORE_API_PRIVATE_KEY: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
# Write API key to file
echo "$APPSTORE_API_PRIVATE_KEY" > AuthKey.p8
# Run notarization script
NOTARY_API_KEY=AuthKey.p8 ./scripts/notarize-macos-app.sh
# Clean up
rm AuthKey.p8
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: macos-app-dmg
path: dist/*.dmg
release:
name: Create GitHub Release
needs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Generate checksums
run: |
cd artifacts
# Hash the raw binaries from the npm artifacts
sha256sum npm-darwin-arm64/bin/native-devtools-mcp > ../checksums.txt
sed -i 's|npm-darwin-arm64/bin/native-devtools-mcp|native-devtools-mcp (aarch64-apple-darwin)|' ../checksums.txt
sha256sum npm-win32-x64/bin/native-devtools-mcp.exe >> ../checksums.txt
sed -i 's|npm-win32-x64/bin/native-devtools-mcp.exe|native-devtools-mcp.exe (x86_64-pc-windows-msvc)|' ../checksums.txt
# Hash the archive files
sha256sum native-devtools-mcp-aarch64-apple-darwin/*.tar.gz >> ../checksums.txt
sed -i 's|native-devtools-mcp-aarch64-apple-darwin/||' ../checksums.txt
sha256sum native-devtools-mcp-x86_64-pc-windows-msvc/*.zip >> ../checksums.txt
sed -i 's|native-devtools-mcp-x86_64-pc-windows-msvc/||' ../checksums.txt
# Hash the DMG if present
if ls macos-app-dmg/*.dmg 1>/dev/null 2>&1; then
sha256sum macos-app-dmg/*.dmg >> ../checksums.txt
sed -i 's|macos-app-dmg/||' ../checksums.txt
fi
cd ..
echo "Generated checksums:"
cat checksums.txt
- name: Extract changelog for this version
id: changelog
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
# Extract the section between "## vX.Y.Z" and the next "## v" heading (or EOF)
NOTES=$(awk "/^## v${VERSION}\$/ { found=1; next } found && /^## v/ { exit } found { print }" CHANGELOG.md | sed '/^$/N;/^\n$/d')
if [ -n "$NOTES" ]; then
echo "has_notes=true" >> "$GITHUB_OUTPUT"
# Write to file for body_path (handles multiline safely)
echo "$NOTES" > RELEASE_BODY.md
else
echo "has_notes=false" >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub Release (with changelog)
if: steps.changelog.outputs.has_notes == 'true'
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/native-devtools-mcp-*/*.tar.gz
artifacts/native-devtools-mcp-*/*.zip
artifacts/macos-app-dmg/*.dmg
checksums.txt
body_path: RELEASE_BODY.md
- name: Create GitHub Release (auto-generated)
if: steps.changelog.outputs.has_notes == 'false'
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/native-devtools-mcp-*/*.tar.gz
artifacts/native-devtools-mcp-*/*.zip
artifacts/macos-app-dmg/*.dmg
checksums.txt
generate_release_notes: true
publish-npm:
name: Publish to npm
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Download npm artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Setup Node.js
uses: actions/setup-node@v4
with:
# Node 24 for npm v11, which supports the current OIDC handshake
# required by Trusted Publishing. Node 22 (npm v10) gets silently
# treated as anonymous and publish fails with a misleading 404.
node-version: "24"
registry-url: "https://registry.npmjs.org"
- name: Copy binaries to npm packages
run: |
# Copy macOS binary
mkdir -p npm/darwin-arm64/bin
cp artifacts/npm-darwin-arm64/bin/native-devtools-mcp npm/darwin-arm64/bin/
chmod +x npm/darwin-arm64/bin/native-devtools-mcp
# Copy Windows binary
mkdir -p npm/win32-x64/bin
cp artifacts/npm-win32-x64/bin/native-devtools-mcp.exe npm/win32-x64/bin/
- name: Copy README to npm package
run: cp README.md npm/
- name: Update versions from tag
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "Publishing version: $VERSION"
# Update main package version
cd npm
npm version $VERSION --no-git-tag-version --allow-same-version
# Update platform package versions
cd darwin-arm64
npm version $VERSION --no-git-tag-version --allow-same-version
cd ../win32-x64
npm version $VERSION --no-git-tag-version --allow-same-version
cd ..
# Update optionalDependencies versions in main package
sed -i "s/\"@sh3ll3x3c\/native-devtools-mcp-darwin-arm64\": \".*\"/\"@sh3ll3x3c\/native-devtools-mcp-darwin-arm64\": \"$VERSION\"/" package.json
sed -i "s/\"@sh3ll3x3c\/native-devtools-mcp-win32-x64\": \".*\"/\"@sh3ll3x3c\/native-devtools-mcp-win32-x64\": \"$VERSION\"/" package.json
- name: Publish darwin-arm64 package
run: npm publish --provenance --access public
working-directory: npm/darwin-arm64
- name: Publish win32-x64 package
run: npm publish --provenance --access public
working-directory: npm/win32-x64
- name: Wait for npm registry to update
run: sleep 30
- name: Publish main package
run: npm publish --provenance --access public
working-directory: npm
publish-mcp-registry:
name: Publish to MCP Registry
needs: publish-npm
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
sudo mv mcp-publisher /usr/local/bin/
- name: Authenticate to MCP Registry
run: mcp-publisher login github-oidc
- name: Update version in server.json
run: |
VERSION=${GITHUB_REF#refs/tags/v}
jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.tmp && mv server.tmp server.json
- name: Publish to MCP Registry
run: mcp-publisher publish
publish-crates:
name: Publish to crates.io
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
# OIDC Trusted Publishing — crates.io mints a short-lived token per run,
# so no CARGO_REGISTRY_TOKEN secret is stored anywhere. Requires a Trusted
# Publisher configured on crates.io for this repo + workflow (release.yml).
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Authenticate to crates.io (Trusted Publishing)
uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: Publish to crates.io
# Version comes from Cargo.toml at the tagged commit (bumped in the
# release commit), so it always matches the tag being released.
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}