Skip to content

Commit f663163

Browse files
authored
chore: release-please configs and a workflow to build/attach the artifact (#52)
1 parent 0e6809e commit f663163

4 files changed

Lines changed: 76 additions & 1 deletion

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Package and Upload Release Assets
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
# This allows you to run the workflow manually from the Actions tab
8+
workflow_dispatch:
9+
inputs:
10+
tag_name:
11+
description: 'The tag of the release to upload assets to'
12+
required: true
13+
type: string
14+
15+
permissions:
16+
# This permission is required for the action to create a GitHub Release
17+
contents: write
18+
19+
jobs:
20+
build-and-package:
21+
runs-on: ubuntu-latest
22+
steps:
23+
# 1. Checks out your repository's code
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
# 2. Sets up the Node.js environment
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20' # Specify the Node.js version you use
32+
cache: 'npm'
33+
# Tell the cache where to find the package-lock.json
34+
cache-dependency-path: mcp-server/package-lock.json
35+
36+
# 3. Install MCP server dependencies
37+
# The MCP server needs its dependencies bundled in the release
38+
- name: Install MCP server dependencies
39+
run: cd mcp-server && npm ci
40+
41+
# 4. Runs your build script
42+
- name: Run build
43+
run: cd mcp-server && npm run build
44+
45+
# 5. Create TAR archive with MCP server dependencies
46+
# Exclude root node_modules but INCLUDE mcp-server/node_modules
47+
- name: Create TAR archive
48+
run: tar -cvzf ../security-release.tar.gz --exclude='.git' --exclude='.github' --exclude='./assets' . && mv ../security-release.tar.gz .
49+
50+
# 6. Upload the TAR archive as a release asset
51+
- name: Upload archive to GitHub Release
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
run: |
55+
gh release upload \
56+
${{ github.event.release.tag_name || inputs.tag_name }} \
57+
security-release.tar.gz

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

gemini-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"mcpServers": {
66
"securityServer": {
77
"command": "node",
8-
"args": ["${extensionPath}/mcp-server/security.ts"]
8+
"args": ["${extensionPath}/mcp-server/dist/security.js"]
99
}
1010
}
1111
}

release-please-config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "simple",
4+
"packages": {
5+
".": {
6+
"extra-files": [
7+
{
8+
"type": "json",
9+
"path": "gemini-extension.json",
10+
"jsonpath": "$.version"
11+
}
12+
]
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)