diff --git a/.github/workflows/readme-check.yml b/.github/workflows/readme-check.yml index b3398ead..bed3ff44 100644 --- a/.github/workflows/readme-check.yml +++ b/.github/workflows/readme-check.yml @@ -19,14 +19,13 @@ jobs: uses: actions/checkout@v4 - name: Check README is up-to-date run: | - cd internal/readme - make + go generate ./internal/readme if [ -n "$(git status --porcelain)" ]; then echo "ERROR: README.md is not up-to-date!" echo "" - echo "The README.md file differs from what would be generated by running 'make' in internal/readme/." + echo "The README.md file differs from what would be generated by `go generate ./internal/readme`." echo "Please update internal/readme/README.src.md instead of README.md directly," - echo "then run 'make' in the internal/readme/ directory to regenerate README.md." + echo "then run `go generate ./internal/readme` to regenerate README.md." echo "" echo "Changes:" git status --porcelain diff --git a/internal/readme/Makefile b/internal/readme/Makefile deleted file mode 100644 index 5e484184..00000000 --- a/internal/readme/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# This makefile builds ../README.md from the files in this directory. - -OUTFILE=../../README.md - -$(OUTFILE): build README.src.md - go run golang.org/x/example/internal/cmd/weave@latest README.src.md > $(OUTFILE) - -# Compile all the code used in the README. -build: $(wildcard */*.go) - go build -o /tmp/mcp-readme/ ./... - -# Preview the README on GitHub. -# $HOME/markdown must be a github repo. -# Visit https://github.com/$HOME/markdown to see the result. -preview: $(OUTFILE) - cp $(OUTFILE) $$HOME/markdown/ - (cd $$HOME/markdown/ && git commit -m . README.md && git push) - -.PHONY: build preview diff --git a/internal/readme/build.sh b/internal/readme/build.sh deleted file mode 100755 index b721d505..00000000 --- a/internal/readme/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Build README.md from the files in this directory. -# Must be invoked from the mcp directory. - -cd ../internal/readme - -outfile=../../README.md - -# Compile all the code used in the README. -go build -o /tmp/mcp-readme/ ./... -# Combine the code with the text in README.src.md. -# TODO: when at Go 1.24, use a tool directive for weave. -go run golang.org/x/example/internal/cmd/weave@latest README.src.md > $outfile - -if [[ $1 = '-preview' ]]; then - # Preview the README on GitHub. - # $HOME/markdown must be a github repo. - # Visit https://github.com/$HOME/markdown to see the result. - cp $outfile $HOME/markdown/ - (cd $HOME/markdown/ && git commit -m . README.md && git push) -fi diff --git a/internal/readme/doc.go b/internal/readme/doc.go new file mode 100644 index 00000000..34bc60c8 --- /dev/null +++ b/internal/readme/doc.go @@ -0,0 +1,9 @@ +// Copyright 2025 The Go MCP SDK Authors. All rights reserved. +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + +//go:generate go run golang.org/x/example/internal/cmd/weave@latest -o ../../README.md ./README.src.md + +// The readme package is used to generate README.md at the top-level of this +// repo. Regenerate the README with go generate. +package readme diff --git a/mcp/mcp.go b/mcp/mcp.go index 839f9199..88321a1e 100644 --- a/mcp/mcp.go +++ b/mcp/mcp.go @@ -2,8 +2,6 @@ // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file. -//go:generate ../internal/readme/build.sh - // The mcp package provides an SDK for writing model context protocol clients // and servers. //