Skip to content

Commit e3e9560

Browse files
feat(release): add nightly and stable release workflows
1 parent d0a1264 commit e3e9560

File tree

5 files changed

+261
-2
lines changed

5 files changed

+261
-2
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Nightly Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build and Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Deno
20+
uses: denoland/setup-deno@v1
21+
with:
22+
deno-version: v1.x
23+
24+
- name: Build binaries
25+
run: deno task build
26+
27+
- name: Get current date
28+
id: date
29+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
30+
31+
- name: Delete existing nightly release
32+
uses: dev-drprasad/delete-tag-and-release@v0.2.1
33+
with:
34+
tag_name: nightly
35+
delete_release: true
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
continue-on-error: true
39+
40+
- name: Create nightly release
41+
uses: softprops/action-gh-release@v1
42+
with:
43+
name: Nightly Build (${{ steps.date.outputs.date }})
44+
tag_name: nightly
45+
prerelease: true
46+
body: |
47+
Nightly build from the latest main branch commit.
48+
Commit: ${{ github.sha }}
49+
Built on: ${{ steps.date.outputs.date }}
50+
51+
⚠️ This is an automated nightly build and may contain bugs or unstable features. Use at your own risk.
52+
files: |
53+
build/valtown-mcp-linux
54+
build/valtown-mcp-windows.exe
55+
build/valtown-mcp-macos
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Stable Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Create Stable Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Deno
20+
uses: denoland/setup-deno@v1
21+
with:
22+
deno-version: v1.x
23+
24+
- name: Build binaries
25+
run: deno task build
26+
27+
- name: Get tag version
28+
id: get_version
29+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
30+
31+
- name: Create release
32+
uses: softprops/action-gh-release@v1
33+
with:
34+
name: ValTown MCP Server ${{ steps.get_version.outputs.VERSION }}
35+
tag_name: ${{ steps.get_version.outputs.VERSION }}
36+
draft: false
37+
prerelease: false
38+
body: |
39+
# ValTown MCP Server ${{ steps.get_version.outputs.VERSION }}
40+
41+
## Installation
42+
43+
Download the appropriate binary for your platform and follow the instructions in the [README](https://github.com/${{ github.repository }}/blob/main/README.md).
44+
45+
## Environment Variables Required
46+
47+
- `VAL_TOWN_API_TOKEN`: Your ValTown API token
48+
49+
## Release Artifacts
50+
51+
- `valtown-mcp-linux`: Linux binary (x86_64)
52+
- `valtown-mcp-windows.exe`: Windows binary (x86_64)
53+
- `valtown-mcp-macos`: macOS binary (x86_64)
54+
files: |
55+
build/valtown-mcp-linux
56+
build/valtown-mcp-windows.exe
57+
build/valtown-mcp-macos
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/conventions.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# ValTown MCP Server Code Conventions
2+
3+
This document outlines the coding standards, architecture, and conventions used
4+
in the ValTown MCP Server project. It serves as both an onboarding guide for new
5+
developers and a reference for AI coding assistants.
6+
7+
## Project Structure
8+
9+
```
10+
valTownMCPServer/
11+
├── lib/ # Core utilities and types
12+
├── tools/ # MCP tools implementations
13+
├── mod.ts # Main entry point
14+
├── server.ts # Server implementation
15+
└── docs/ # Documentation
16+
```
17+
18+
## TypeScript Conventions
19+
20+
### General Style
21+
22+
- Use TypeScript strict mode
23+
- Prefer explicit typing over inferred types for function parameters and returns
24+
- Use interfaces for object shapes and types for unions/aliases
25+
- Indent with 2 spaces
26+
- Use semicolons at the end of statements
27+
28+
### Naming Conventions
29+
30+
- `camelCase` for variables, functions, and method names
31+
- `PascalCase` for interface, type, class, and enum names
32+
- `UPPER_SNAKE_CASE` for constants
33+
- Descriptive names that indicate purpose (avoid abbreviations)
34+
35+
### Example
36+
37+
```typescript
38+
// Good
39+
interface UserResponse {
40+
id: string;
41+
username: string;
42+
}
43+
44+
async function fetchUserData(userId: string): Promise<UserResponse> {
45+
// Implementation
46+
}
47+
48+
// Avoid
49+
interface resp {
50+
id: string;
51+
uname: string;
52+
}
53+
54+
async function fetch(id) {
55+
// Implementation
56+
}
57+
```
58+
59+
## MCP Tool Conventions
60+
61+
### Tool Implementation
62+
63+
- Each tool should have a clear, specific purpose
64+
- Tool names should be kebab-case (e.g., `get-val`, `run-function`)
65+
- Tool descriptions should be concise but comprehensive
66+
- Parameters should have descriptive names and appropriate validation
67+
- Tools should handle errors gracefully
68+
- Return consistent response formats
69+
70+
### Example Tool Registration
71+
72+
```typescript
73+
server.tool(
74+
"run-function",
75+
"Execute a ValTown function by its ID or URL",
76+
{
77+
functionIdentifier: z.string().describe("Function ID or URL to execute"),
78+
args: z.array(z.any()).optional().describe(
79+
"Arguments to pass to the function",
80+
),
81+
},
82+
async ({ functionIdentifier, args = [] }) => {
83+
try {
84+
// Implementation
85+
return {
86+
content: [{ type: "text", text: "Result data" }],
87+
};
88+
} catch (error) {
89+
return {
90+
content: [{ type: "text", text: `Error: ${getErrorMessage(error)}` }],
91+
isError: true,
92+
};
93+
}
94+
},
95+
);
96+
```
97+
98+
## Error Handling
99+
100+
- Use try/catch blocks for all async operations
101+
- Use the `getErrorMessage` utility for consistent error message extraction
102+
- Return appropriate error responses with isError flag set to true
103+
- Log errors with relevant context
104+
105+
## Testing Conventions
106+
107+
- Unit tests for individual functions
108+
- Integration tests for API interactions
109+
- Test files should be named `*.test.ts`
110+
- Use descriptive test names that explain the expected behavior
111+
112+
## Version Control
113+
114+
- Commit messages should follow
115+
[Conventional Commits](https://www.conventionalcommits.org/) format
116+
- Feature branches should follow the pattern `feature/description-of-feature`
117+
- Bug fix branches should follow the pattern `fix/description-of-bug`
118+
119+
## Documentation
120+
121+
- Document all public functions and interfaces with JSDoc comments
122+
- Keep README.md up to date with installation and usage instructions
123+
- Add examples for common use cases
124+
125+
## Environment Variables
126+
127+
- Document all required environment variables
128+
- Use sensible defaults when possible
129+
- Validate environment variables at startup
130+
131+
## Performance Considerations
132+
133+
- Minimize external API calls
134+
- Use appropriate caching strategies
135+
- Handle rate limiting gracefully
136+
137+
## Security Practices
138+
139+
- Never commit API tokens or secrets
140+
- Validate and sanitize all user inputs
141+
- Follow the principle of least privilege
142+
143+
```
144+
By following these conventions, we maintain a consistent, high-quality codebase that is easier to maintain and extend.
145+
```

node_modules/@modelcontextprotocol/sdk

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/zod

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)