-
Notifications
You must be signed in to change notification settings - Fork 6
117 lines (100 loc) · 3.21 KB
/
build-github-mcp-server.yml
File metadata and controls
117 lines (100 loc) · 3.21 KB
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
name: Build and Publish GitHub MCP Server
on:
workflow_dispatch:
inputs:
version:
description: 'Package version (e.g. 0.0.1)'
required: true
default: '0.0.1'
type: string
uipath_access_token:
description: 'UiPath Access Token'
required: true
type: string
uipath_url:
description: 'UiPath URL'
required: true
default: 'https://alpha.uipath.com/ada/byoa'
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: github/github-mcp-server
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build MCP Server
run: |
cd cmd/github-mcp-server
go build
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install UV
run: pip install uv
- name: Prepare package directory
run: |
mkdir -p temp
cp cmd/github-mcp-server/github-mcp-server temp
chmod +x temp/github-mcp-server
- name: Create MCP config file
run: |
cat > temp/mcp.json << EOF
{
"servers": {
"github": {
"command": "/bin/sh",
"args": ["-c", "chmod +x github-mcp-server && ./github-mcp-server stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "x"
}
}
}
}
EOF
- name: Create pyproject.toml
run: |
cat > temp/pyproject.toml << EOF
[project]
name = "mcp-github-server"
version = "${{ github.event.inputs.version }}"
description = "Official GitHub MCP Server"
authors = [{ name = "John Doe" }]
dependencies = [
"uipath-mcp>=0.0.78",
]
requires-python = ">=3.10"
EOF
- name: Create .env file
run: |
cat > temp/.env << EOF
UIPATH_ACCESS_TOKEN=${{ github.event.inputs.uipath_access_token }}
UIPATH_URL=${{ github.event.inputs.uipath_url }}
EOF
- name: Setup Python environment and package
working-directory: ./temp
run: |
# Create and activate virtual environment
uv venv -p 3.10 .venv
source .venv/bin/activate
# Install dependencies
uv sync
# Initialize uipath
uipath init
# Modify uipath.json to add settings
python -c "import json; f=open('uipath.json','r'); data=json.load(f); f.close(); data['settings']={'filesIncluded':['github-mcp-server']}; f=open('uipath.json','w'); json.dump(data,f,indent=4); f.close(); print('Updated uipath.json')"
# Show the modified file
cat uipath.json
# Continue with packing
uipath pack
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mcp-github-server-${{ github.event.inputs.version }}
path: temp/.uipath/mcp-github-server.${{ github.event.inputs.version }}.nupkg