Skip to content

Commit 5aa051b

Browse files
committed
feat: add CI and npm publish workflows; update package.json and tsconfig for TypeScript support
1 parent d3be793 commit 5aa051b

4 files changed

Lines changed: 164 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# Copyright 2026 100monkeys.ai
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches: [main]
9+
paths:
10+
- 'zaru-mcp-server/**'
11+
- '.github/workflows/ci.yml'
12+
pull_request:
13+
branches: [main]
14+
paths:
15+
- 'zaru-mcp-server/**'
16+
- '.github/workflows/ci.yml'
17+
18+
defaults:
19+
run:
20+
working-directory: zaru-mcp-server
21+
22+
jobs:
23+
lint-and-build:
24+
name: Lint & Build
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: 'npm'
35+
cache-dependency-path: zaru-mcp-server/package-lock.json
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Build
41+
run: npm run build

.github/workflows/npm-publish.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# SPDX-License-Identifier: AGPL-3.0-only
2+
# Copyright 2026 100monkeys.ai
3+
4+
name: Publish npm
5+
6+
on:
7+
push:
8+
tags:
9+
- '*.*.*'
10+
workflow_dispatch:
11+
inputs:
12+
dry_run:
13+
description: 'Perform a dry run (no actual publishing)'
14+
required: false
15+
type: boolean
16+
default: false
17+
18+
defaults:
19+
run:
20+
working-directory: zaru-mcp-server
21+
22+
permissions:
23+
contents: write
24+
packages: write
25+
26+
jobs:
27+
verify:
28+
name: Verify build
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Set up Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '20'
38+
cache: 'npm'
39+
cache-dependency-path: zaru-mcp-server/package-lock.json
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
44+
- name: Build
45+
run: npm run build
46+
47+
publish:
48+
name: Publish @100monkeys-ai/zaru-mcp-server
49+
needs: verify
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up Node.js
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: '20'
59+
registry-url: 'https://npm.pkg.github.com'
60+
scope: '@100monkeys-ai'
61+
cache: 'npm'
62+
cache-dependency-path: zaru-mcp-server/package-lock.json
63+
64+
- name: Install dependencies
65+
run: npm ci
66+
67+
- name: Build
68+
run: npm run build
69+
70+
- name: Publish package
71+
run: |
72+
if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then
73+
echo "🔍 DRY RUN: Would publish @100monkeys-ai/zaru-mcp-server"
74+
npm publish --dry-run
75+
else
76+
echo "📦 Publishing @100monkeys-ai/zaru-mcp-server to GitHub Packages..."
77+
npm publish
78+
fi
79+
env:
80+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
82+
release:
83+
name: Create GitHub Release
84+
needs: publish
85+
if: github.event_name == 'push'
86+
runs-on: ubuntu-latest
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
91+
- name: Get version
92+
id: version
93+
run: |
94+
VERSION="${GITHUB_REF#refs/tags/}"
95+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
96+
if [[ "${VERSION}" == *"-"* ]]; then
97+
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
98+
else
99+
echo "IS_PRERELEASE=false" >> $GITHUB_OUTPUT
100+
fi
101+
working-directory: .
102+
103+
- name: Create Release
104+
uses: softprops/action-gh-release@v2
105+
with:
106+
tag_name: ${{ steps.version.outputs.VERSION }}
107+
name: "@100monkeys-ai/zaru-mcp-server ${{ steps.version.outputs.VERSION }}"
108+
draft: false
109+
prerelease: ${{ steps.version.outputs.IS_PRERELEASE == 'true' }}
110+
generate_release_notes: true
111+
env:
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

zaru-mcp-server/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
{
2-
"name": "zaru-mcp-server",
2+
"name": "@100monkeys-ai/zaru-mcp-server",
33
"version": "0.11.0-pre-alpha",
4-
"description": "",
5-
"main": "index.js",
4+
"description": "Zaru MCP Server - Secure Model Context Protocol gateway for Zaru",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
67
"scripts": {
8+
"build": "tsc",
9+
"prepare": "npm run build",
710
"test": "echo \"Error: no test specified\" && exit 1"
811
},
12+
"publishConfig": {
13+
"registry": "https://npm.pkg.github.com"
14+
},
915
"keywords": [],
10-
"author": "",
16+
"author": "100monkeys.ai",
1117
"license": "MIT",
1218
"type": "module",
1319
"dependencies": {

zaru-mcp-server/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"target": "ES2022",
44
"module": "NodeNext",
55
"moduleResolution": "NodeNext",
6+
"declaration": true,
67
"esModuleInterop": true,
78
"forceConsistentCasingInFileNames": true,
89
"strict": true,

0 commit comments

Comments
 (0)