Skip to content

Commit ab971d9

Browse files
authored
feat: add cross-platform binary releases and restructure setup docs (#74)
Enable users to install the MCP server as a standalone binary (no Go or Docker required) by building and publishing cross-platform binaries alongside the existing Docker images. The README is restructured to present all three installation methods (Go, Docker, Binary) as equal options, with CLI examples for Claude Code, Gemini CLI, and Codex CLI. - Add `build-binaries` job to the publish workflow producing archives for darwin/linux/windows across amd64/arm64/386, with SHA-256 checksums attached to each GitHub Release. - Reorganize the README "Running the Server" section into "Server Setup" with dedicated subsections for Go, Docker, and Binary, eliminating duplicated JSON configs across the Quickstart and Client Configuration sections. - Add `claude mcp add`, `gemini mcp add`, and `codex mcp add` CLI examples for both Go and Binary installation methods.
1 parent 07a0594 commit ab971d9

File tree

2 files changed

+249
-145
lines changed

2 files changed

+249
-145
lines changed

.github/workflows/publish.yaml

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Publish Docker image
2+
name: Publish
33

44
on:
55
push:
@@ -174,15 +174,74 @@ jobs:
174174
VERSION: ${{ needs.get-newer-version.outputs.new-version }}
175175
run: docker buildx imagetools inspect $REGISTRY:${VERSION}
176176

177+
build-binaries:
178+
name: Build ${{ matrix.goos }}-${{ matrix.goarch }} binary
179+
runs-on: ubuntu-latest
180+
needs: [ get-newer-version ]
181+
if: needs.get-newer-version.outputs.new-version != ''
182+
defaults:
183+
run:
184+
shell: nix develop --command bash {0}
185+
permissions:
186+
contents: read
187+
strategy:
188+
matrix:
189+
include:
190+
- { goos: darwin, goarch: arm64, ext: tar.gz }
191+
- { goos: darwin, goarch: amd64, ext: tar.gz }
192+
- { goos: linux, goarch: arm64, ext: tar.gz }
193+
- { goos: linux, goarch: amd64, ext: tar.gz }
194+
- { goos: linux, goarch: "386", ext: tar.gz }
195+
- { goos: windows, goarch: arm64, ext: zip }
196+
- { goos: windows, goarch: amd64, ext: zip }
197+
- { goos: windows, goarch: "386", ext: zip }
198+
steps:
199+
- name: Check out the repo
200+
uses: actions/checkout@v5
201+
202+
- name: Install Nix
203+
# Pinned to v21 commit SHA for supply-chain safety.
204+
# To update: git ls-remote https://github.com/DeterminateSystems/nix-installer-action.git <tag>
205+
uses: DeterminateSystems/nix-installer-action@c5a866b6ab867e88becbed4467b93592bce69f8a # v21
206+
207+
- name: Enable Nix cache
208+
# Pinned to v13 commit SHA for supply-chain safety.
209+
# To update: git ls-remote https://github.com/DeterminateSystems/magic-nix-cache-action.git <tag>
210+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
211+
with:
212+
use-flakehub: false
213+
214+
- name: Build and package binary
215+
env:
216+
VERSION: ${{ needs.get-newer-version.outputs.new-version }}
217+
ARCHIVE: sysdig-mcp-server_${{ matrix.goos }}-${{ matrix.goarch }}
218+
BINARY: sysdig-mcp-server${{ matrix.goos == 'windows' && '.exe' || '' }}
219+
run: |
220+
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \
221+
go build -ldflags "-w -s -X main.Version=${VERSION}" -o "${BINARY}" ./cmd/server
222+
if [ "${{ matrix.ext }}" = "tar.gz" ]; then
223+
tar -czf "${ARCHIVE}.tar.gz" "${BINARY}"
224+
else
225+
zip "${ARCHIVE}.zip" "${BINARY}"
226+
fi
227+
228+
- name: Upload artifact
229+
uses: actions/upload-artifact@v5
230+
with:
231+
name: binary-${{ matrix.goos }}-${{ matrix.goarch }}
232+
path: sysdig-mcp-server_${{ matrix.goos }}-${{ matrix.goarch }}.${{ matrix.ext }}
233+
if-no-files-found: error
234+
retention-days: 1
235+
177236
release:
178237
name: Create release at Github
179-
needs: [ get-newer-version ]
238+
needs: [ get-newer-version, push_to_registry, build-binaries ]
180239
if: needs.get-newer-version.outputs.new-version != ''
181240
runs-on: ubuntu-latest
182241
permissions:
183242
contents: write # Required for release creation
184243
steps:
185-
- uses: actions/checkout@v4
244+
- uses: actions/checkout@v5
186245
with:
187246
fetch-depth: 0
188247
fetch-tags: true
@@ -208,10 +267,22 @@ jobs:
208267
- name: Generate changelog
209268
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
210269

270+
- name: Download binary artifacts
271+
uses: actions/download-artifact@v6
272+
with:
273+
path: /tmp/binaries
274+
pattern: binary-*
275+
merge-multiple: true
276+
277+
- name: Generate checksums
278+
working-directory: /tmp/binaries
279+
run: sha256sum * > checksums.txt
280+
211281
- name: Create release
212282
uses: softprops/action-gh-release@v2
213283
with:
214284
name: ${{ needs.get-newer-version.outputs.new-version }}
215285
tag_name: ${{ needs.get-newer-version.outputs.new-version }}
216286
prerelease: false
217287
body_path: RELEASE_CHANGELOG.md
288+
files: /tmp/binaries/*

0 commit comments

Comments
 (0)