|
| 1 | +name: Build and Publish GitHub MCP Server |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Package version (e.g. 0.0.1)' |
| 8 | + required: true |
| 9 | + default: '0.0.1' |
| 10 | + type: string |
| 11 | + uipath_access_token: |
| 12 | + description: 'UiPath Access Token' |
| 13 | + required: true |
| 14 | + type: string |
| 15 | + uipath_url: |
| 16 | + description: 'UiPath URL' |
| 17 | + required: true |
| 18 | + default: 'https://alpha.uipath.com/ada/byoa' |
| 19 | + type: string |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + repository: github/github-mcp-server |
| 29 | + |
| 30 | + - name: Set up Go |
| 31 | + uses: actions/setup-go@v5 |
| 32 | + with: |
| 33 | + go-version: '1.21' |
| 34 | + |
| 35 | + - name: Build MCP Server |
| 36 | + run: | |
| 37 | + cd cmd/github-mcp-server |
| 38 | + go build |
| 39 | +
|
| 40 | + - name: Set up Python |
| 41 | + uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: '3.10' |
| 44 | + |
| 45 | + - name: Install UV |
| 46 | + run: pip install uv |
| 47 | + |
| 48 | + - name: Prepare package directory |
| 49 | + run: | |
| 50 | + mkdir -p temp |
| 51 | + cp cmd/github-mcp-server/github-mcp-server temp |
| 52 | + chmod +x temp/github-mcp-server |
| 53 | +
|
| 54 | + - name: Create MCP config file |
| 55 | + run: | |
| 56 | + cat > temp/mcp.json << EOF |
| 57 | + { |
| 58 | + "servers": { |
| 59 | + "github": { |
| 60 | + "command": "/bin/sh", |
| 61 | + "args": ["-c", "chmod +x github-mcp-server && ./github-mcp-server stdio"], |
| 62 | + "env": { |
| 63 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "x" |
| 64 | + } |
| 65 | + } |
| 66 | + } |
| 67 | + } |
| 68 | + EOF |
| 69 | +
|
| 70 | + - name: Create pyproject.toml |
| 71 | + run: | |
| 72 | + cat > temp/pyproject.toml << EOF |
| 73 | + [project] |
| 74 | + name = "mcp-github-server" |
| 75 | + version = "${{ github.event.inputs.version }}" |
| 76 | + description = "Official GitHub MCP Server" |
| 77 | + authors = [{ name = "John Doe" }] |
| 78 | + dependencies = [ |
| 79 | + "uipath-mcp==0.0.74", |
| 80 | + ] |
| 81 | + requires-python = ">=3.10" |
| 82 | + EOF |
| 83 | +
|
| 84 | + - name: Create .env file |
| 85 | + run: | |
| 86 | + cat > temp/.env << EOF |
| 87 | + UIPATH_ACCESS_TOKEN=${{ github.event.inputs.uipath_access_token }} |
| 88 | + UIPATH_URL=${{ github.event.inputs.uipath_url }} |
| 89 | + EOF |
| 90 | +
|
| 91 | + - name: Setup Python environment and package |
| 92 | + working-directory: ./temp |
| 93 | + run: | |
| 94 | + # Create and activate virtual environment |
| 95 | + uv venv -p 3.10 .venv |
| 96 | + source .venv/bin/activate |
| 97 | +
|
| 98 | + # Install dependencies |
| 99 | + uv sync |
| 100 | +
|
| 101 | + # Initialize uipath |
| 102 | + uipath init |
| 103 | +
|
| 104 | + # Modify uipath.json to add settings |
| 105 | + 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')" |
| 106 | +
|
| 107 | + # Show the modified file |
| 108 | + cat uipath.json |
| 109 | +
|
| 110 | + # Continue with packing |
| 111 | + uipath pack |
| 112 | +
|
| 113 | + - name: Upload artifact |
| 114 | + uses: actions/upload-artifact@v4 |
| 115 | + with: |
| 116 | + name: mcp-github-server-${{ github.event.inputs.version }} |
| 117 | + path: temp/.uipath/mcp-github-server.${{ github.event.inputs.version }}.nupkg |
0 commit comments