Skip to content

Commit c5dcf12

Browse files
Copilotaliok
andauthored
Build server binaries as part of release automation (#189)
* Initial plan * Add server binary builds to release automation - Add build-server-platform make target for building server binaries per platform - Update create-release.yaml to build and upload server binaries - Update publish-release.yaml to build and upload server binaries - Update nightly-release.yaml to build and upload server binaries - Update .gitignore to ignore platform-specific binaries - Update CHANGELOG.md with release automation changes Co-authored-by: aliok <[email protected]> * Remove CHANGELOG.md update - will be done during release Co-authored-by: aliok <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: aliok <[email protected]>
1 parent c10cf64 commit c5dcf12

File tree

5 files changed

+71
-3
lines changed

5 files changed

+71
-3
lines changed

.github/workflows/create-release.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
with:
120120
go-version-file: 'go.mod'
121121

122-
- name: Build genmcp
122+
- name: Build genmcp CLI
123123
env:
124124
GOOS: ${{ matrix.goos }}
125125
GOARCH: ${{ matrix.goarch }}
@@ -136,6 +136,22 @@ jobs:
136136
137137
zip "${CLI_NAME}-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}"
138138
139+
- name: Build genmcp-server
140+
env:
141+
GOOS: ${{ matrix.goos }}
142+
GOARCH: ${{ matrix.goarch }}
143+
run: |
144+
make build-server-platform GOOS=${GOOS} GOARCH=${GOARCH}
145+
146+
SERVER_NAME="genmcp-server"
147+
if [ "${GOOS}" == "windows" ]; then
148+
OUTPUT_NAME="${SERVER_NAME}-${GOOS}-${GOARCH}.exe"
149+
else
150+
OUTPUT_NAME="${SERVER_NAME}-${GOOS}-${GOARCH}"
151+
fi
152+
153+
zip "${SERVER_NAME}-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}"
154+
139155
- name: Upload assets to release
140156
run: |
141157
VERSION="${{ needs.determine-version.outputs.prerelease_version }}"

.github/workflows/nightly-release.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
with:
136136
go-version-file: 'go.mod'
137137

138-
- name: Build genmcp
138+
- name: Build genmcp CLI
139139
env:
140140
GOOS: ${{ matrix.goos }}
141141
GOARCH: ${{ matrix.goarch }}
@@ -152,6 +152,22 @@ jobs:
152152
153153
zip "${CLI_NAME}-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}"
154154
155+
- name: Build genmcp-server
156+
env:
157+
GOOS: ${{ matrix.goos }}
158+
GOARCH: ${{ matrix.goarch }}
159+
run: |
160+
make build-server-platform GOOS=${GOOS} GOARCH=${GOARCH}
161+
162+
SERVER_NAME="genmcp-server"
163+
if [ "${GOOS}" == "windows" ]; then
164+
OUTPUT_NAME="${SERVER_NAME}-${GOOS}-${GOARCH}.exe"
165+
else
166+
OUTPUT_NAME="${SERVER_NAME}-${GOOS}-${GOARCH}"
167+
fi
168+
169+
zip "${SERVER_NAME}-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}"
170+
155171
- name: Upload assets to nightly release
156172
run: |
157173
VERSION="${{ needs.check-and-create-nightly.outputs.nightly_version }}"

.github/workflows/publish-release.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
with:
138138
go-version-file: 'go.mod'
139139

140-
- name: Build genmcp
140+
- name: Build genmcp CLI
141141
env:
142142
GOOS: ${{ matrix.goos }}
143143
GOARCH: ${{ matrix.goarch }}
@@ -154,6 +154,22 @@ jobs:
154154
155155
zip "${CLI_NAME}-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}"
156156
157+
- name: Build genmcp-server
158+
env:
159+
GOOS: ${{ matrix.goos }}
160+
GOARCH: ${{ matrix.goarch }}
161+
run: |
162+
make build-server-platform GOOS=${GOOS} GOARCH=${GOARCH}
163+
164+
SERVER_NAME="genmcp-server"
165+
if [ "${GOOS}" == "windows" ]; then
166+
OUTPUT_NAME="${SERVER_NAME}-${GOOS}-${GOARCH}.exe"
167+
else
168+
OUTPUT_NAME="${SERVER_NAME}-${GOOS}-${GOARCH}"
169+
fi
170+
171+
zip "${SERVER_NAME}-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}"
172+
157173
- name: Upload assets to release
158174
run: |
159175
VERSION="${{ needs.determine-version.outputs.version }}"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ profile.cov
2222

2323
# Built CLI binary
2424
genmcp
25+
genmcp-*
26+
27+
# Built server binary
2528
genmcp-server
29+
genmcp-server-*
2630

2731
# Go workspace file
2832
go.work

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,21 @@ build-cli-platform: build-server-binaries
6060
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o "$$OUTPUT_NAME" ./cmd/genmcp; \
6161
fi
6262

63+
.PHONY: build-server-platform
64+
build-server-platform:
65+
@if [ -z "$(GOOS)" ] || [ -z "$(GOARCH)" ]; then \
66+
echo "Error: GOOS and GOARCH must be set"; \
67+
echo "Usage: make build-server-platform GOOS=linux GOARCH=amd64"; \
68+
exit 1; \
69+
fi
70+
@SERVER_NAME="$(SERVER_BINARY_NAME)"; \
71+
if [ "$(GOOS)" = "windows" ]; then \
72+
OUTPUT_NAME="$${SERVER_NAME}-$(GOOS)-$(GOARCH).exe"; \
73+
else \
74+
OUTPUT_NAME="$${SERVER_NAME}-$(GOOS)-$(GOARCH)"; \
75+
fi; \
76+
echo "Building $$OUTPUT_NAME with GOOS=$(GOOS) GOARCH=$(GOARCH)"; \
77+
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o "$$OUTPUT_NAME" $(SERVER_CMD)
78+
6379
.PHONY: build
6480
build: build-server-binaries build-cli

0 commit comments

Comments
 (0)