diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index 703067ac..c7df2d21 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -2,7 +2,7 @@ name: Build All Platforms on: push: - branches: [ dev_cross_build, dev_improve_client_fetch_tools_cross_build ] + branches: [ br_release ] workflow_dispatch: inputs: build_type: @@ -13,11 +13,6 @@ on: options: - Release - Debug - version: - description: 'Library version (e.g., 0.1.0)' - required: false - default: '0.1.0' - type: string create_release: description: 'Create GitHub Release' required: false @@ -30,7 +25,6 @@ permissions: env: BUILD_TYPE: ${{ github.event.inputs.build_type || 'Release' }} - LIB_VERSION: ${{ github.event.inputs.version || '0.1.0' }} jobs: # Linux builds (x64 and ARM64) @@ -215,13 +209,24 @@ jobs: runs-on: ubuntu-latest needs: [build-linux, build-windows, build-macos] if: | - (github.event_name == 'push' && (github.ref == 'refs/heads/dev_cross_build' || github.ref == 'refs/heads/dev_improve_client_fetch_tools_cross_build')) || + (github.event_name == 'push' && github.ref == 'refs/heads/br_release') || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true') steps: - name: Checkout code uses: actions/checkout@v4 + - name: Extract version from CMakeLists.txt + id: version + run: | + VERSION=$(grep -E "^project\(gopher-mcp VERSION" CMakeLists.txt | sed -E 's/.*VERSION ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') + if [ -z "$VERSION" ]; then + echo "Error: Could not extract version from CMakeLists.txt" + exit 1 + fi + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "Extracted version: ${VERSION}" + - name: Download all artifacts uses: actions/download-artifact@v4 with: @@ -272,62 +277,63 @@ jobs: echo "=== Release Archives ===" ls -la *.tar.gz *.zip 2>/dev/null || true - - name: Generate build report + - name: Extract changelog for release + id: changelog run: | - cat > BUILD_REPORT.md << EOF - # Build Report - libgopher-mcp + VERSION="${{ steps.version.outputs.version }}" + # Extract the content of the latest version section from CHANGELOG.md + # Find the section starting with ## [VERSION] and ending before the next ## [ + if [ -f "CHANGELOG.md" ]; then + # Extract content between ## [VERSION] and the next ## [ + CHANGELOG_CONTENT=$(awk -v ver="$VERSION" ' + /^## \[/ { + if (found) exit + if ($0 ~ "\\[" ver "\\]") found=1 + next + } + found { print } + ' CHANGELOG.md) + + if [ -z "$CHANGELOG_CONTENT" ]; then + CHANGELOG_CONTENT="No changelog entry found for version ${VERSION}" + fi + else + CHANGELOG_CONTENT="CHANGELOG.md not found" + fi + # Write to file for use in release notes + echo "$CHANGELOG_CONTENT" > CHANGELOG_SECTION.md + + - name: Generate release notes + run: | + VERSION="${{ steps.version.outputs.version }}" + cat > RELEASE_NOTES.md << EOF ## Build Information - - **Date:** $(date -u +"%Y-%m-%d %H:%M:%S UTC") - - **Commit:** ${{ github.sha }} - - **Branch:** ${{ github.ref_name }} - - **Build Type:** ${{ env.BUILD_TYPE }} - - **Library Version:** ${{ env.LIB_VERSION }} - - ## Platforms Built - - ### Linux - - ✅ x64 (Ubuntu 20.04+, GLIBC 2.31+) - - ✅ ARM64 (Ubuntu 20.04+, GLIBC 2.31+) - - ### Windows - - ✅ x64 (Windows 7+, MinGW-w64) - - ✅ ARM64 (Windows 10+, LLVM-MinGW) - - ### macOS - - ✅ x64 (macOS 10.15+, Intel) - - ✅ ARM64 (macOS 11.0+, Apple Silicon) - - ## Package Contents - - Each platform package includes: - - Main library (\`.so\`, \`.dll\`, or \`.dylib\`) - - C API library for FFI bindings - - Import library (\`.lib\` for Windows) - - Header files (\`include/\`) - - Verification tool - - ## Usage - - ### Linux/macOS - \`\`\`bash - tar -xzf libgopher-mcp-.tar.gz - ./verify_mcp # Test the library - \`\`\` - - ### Windows - \`\`\`powershell - Expand-Archive libgopher-mcp-windows-.zip - .\verify_mcp.exe # Test the library - \`\`\` + + | Field | Value | + |-------|-------| + | **Version** | ${VERSION} | + | **Date** | $(date -u +"%Y-%m-%d %H:%M:%S UTC") | + | **Commit** | ${{ github.sha }} | + | **Branch** | ${{ github.ref_name }} | + | **Build Type** | ${{ env.BUILD_TYPE }} | + + ### Platforms + - Linux: x64, ARM64 + - Windows: x64, ARM64 + - macOS: x64, ARM64 + + ## What's Changed + EOF + cat CHANGELOG_SECTION.md >> RELEASE_NOTES.md + - name: Generate release tag id: tag run: | - VERSION="${{ env.LIB_VERSION }}" - TIMESTAMP=$(date +%Y%m%d-%H%M%S) - TAG="v${VERSION}-${TIMESTAMP}" + VERSION="${{ steps.version.outputs.version }}" + TAG="v${VERSION}" echo "tag=${TAG}" >> $GITHUB_OUTPUT echo "Release tag: ${TAG}" @@ -336,7 +342,7 @@ jobs: with: tag_name: ${{ steps.tag.outputs.tag }} name: libgopher-mcp ${{ steps.tag.outputs.tag }} - body_path: BUILD_REPORT.md + body_path: RELEASE_NOTES.md draft: false prerelease: false files: | diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..87262578 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +### Fixed + + +## [0.1.1] - 2026-03-03 + +### Added + +### Changed + +### Fixed + +## [0.1.0] - 2025-12-15 + +### Added +- Full MCP 2025-06-18 specification implementation +- JSON-RPC 2.0 protocol support +- Transport layers: stdio, HTTP+SSE, HTTPS+SSE, TCP +- Filter chain architecture with HTTP codec, SSE codec, routing +- Connection pooling and management +- C API bindings for FFI (Python, TypeScript, Go, Rust, Java, C#, Ruby) +- Cross-platform support: Linux, macOS, Windows (x64 and ARM64) +- libevent-based event loop integration +- SSL/TLS transport support +- Comprehensive logging framework diff --git a/CMakeLists.txt b/CMakeLists.txt index e968276f..2081d5fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ Please create a build directory and run cmake from there: You may need to remove CMakeCache.txt and CMakeFiles/") endif() -project(gopher-mcp VERSION 0.1.0 LANGUAGES C CXX) +project(gopher-mcp VERSION 0.1.1 LANGUAGES C CXX) # Set library version for shared libraries set(GOPHER_MCP_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) diff --git a/docker-mcp/Dockerfile.linux-arm64-cross b/docker-mcp/Dockerfile.linux-arm64-cross index 381914ab..ede811ac 100644 --- a/docker-mcp/Dockerfile.linux-arm64-cross +++ b/docker-mcp/Dockerfile.linux-arm64-cross @@ -85,7 +85,7 @@ RUN mkdir -p cmake-build && cd cmake-build && \ PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu/pkgconfig \ cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=/build/toolchain-aarch64.cmake \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=14 \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=ON \ diff --git a/docker-mcp/Dockerfile.linux-x64 b/docker-mcp/Dockerfile.linux-x64 index 53c10975..2c52dd9f 100644 --- a/docker-mcp/Dockerfile.linux-x64 +++ b/docker-mcp/Dockerfile.linux-x64 @@ -19,7 +19,7 @@ COPY . /build/ # Create build directory and build RUN mkdir -p cmake-build && cd cmake-build && \ cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=14 \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=ON \ diff --git a/docker-mcp/Dockerfile.windows-arm64-llvm b/docker-mcp/Dockerfile.windows-arm64-llvm index ecac2990..405f01f7 100644 --- a/docker-mcp/Dockerfile.windows-arm64-llvm +++ b/docker-mcp/Dockerfile.windows-arm64-llvm @@ -117,7 +117,7 @@ RUN mkdir -p cmake-build && cd cmake-build && \ cmake \ -DCMAKE_TOOLCHAIN_FILE=/build/toolchain-win-arm64.cmake \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=14 \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=OFF \ -DBUILD_TESTS=OFF \ diff --git a/docker-mcp/Dockerfile.windows-x64 b/docker-mcp/Dockerfile.windows-x64 index 339de556..a7418e5a 100644 --- a/docker-mcp/Dockerfile.windows-x64 +++ b/docker-mcp/Dockerfile.windows-x64 @@ -140,7 +140,7 @@ RUN mkdir -p cmake-build && cd cmake-build && \ cmake \ -DCMAKE_TOOLCHAIN_FILE=/build/toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=14 \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=OFF \ -DBUILD_TESTS=OFF \ diff --git a/docker-mcp/build-mac-arm64.sh b/docker-mcp/build-mac-arm64.sh index c0d447bd..71e3ec74 100755 --- a/docker-mcp/build-mac-arm64.sh +++ b/docker-mcp/build-mac-arm64.sh @@ -128,7 +128,7 @@ export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/lib/pkgconfig:${OPENSSL_ROOT}/lib/pkg CMAKE_ARGS=( -DCMAKE_BUILD_TYPE=Release - -DCMAKE_CXX_STANDARD=17 + -DCMAKE_CXX_STANDARD=14 -DCMAKE_OSX_DEPLOYMENT_TARGET=${MIN_MACOS_VERSION} -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_POSITION_INDEPENDENT_CODE=ON diff --git a/docker-mcp/build-mac-x64.sh b/docker-mcp/build-mac-x64.sh index d3ada32e..420ef854 100755 --- a/docker-mcp/build-mac-x64.sh +++ b/docker-mcp/build-mac-x64.sh @@ -80,7 +80,7 @@ fi cmake \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=14 \ -DCMAKE_OSX_DEPLOYMENT_TARGET=${MIN_MACOS_VERSION} \ -DCMAKE_OSX_ARCHITECTURES=x86_64 \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ diff --git a/dump-version.sh b/dump-version.sh new file mode 100755 index 00000000..1b35d8e8 --- /dev/null +++ b/dump-version.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# dump-version.sh - Update CHANGELOG.md with version from CMakeLists.txt +# +# This script: +# 1. Extracts version from CMakeLists.txt +# 2. Moves [Unreleased] content to a new versioned section +# 3. Adds new empty [Unreleased] section at top +# +# Usage: ./dump-version.sh + +set -e + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +CMAKE_FILE="${SCRIPT_DIR}/CMakeLists.txt" +CHANGELOG_FILE="${SCRIPT_DIR}/CHANGELOG.md" + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +# Extract version from CMakeLists.txt +# Matches: project(gopher-mcp VERSION 0.1.0 LANGUAGES C CXX) +VERSION=$(grep -E "^project\(gopher-mcp VERSION" "$CMAKE_FILE" | sed -E 's/.*VERSION ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') + +if [ -z "$VERSION" ]; then + echo -e "${RED}Error: Could not extract version from CMakeLists.txt${NC}" + exit 1 +fi + +echo -e "${YELLOW}Extracted version: ${GREEN}${VERSION}${NC}" + +# Check if this version tag already exists in git +TAG="v${VERSION}" +if git tag -l "$TAG" | grep -q "^${TAG}$"; then + echo -e "${RED}Error: Git tag '${TAG}' already exists!${NC}" + echo -e "${YELLOW}Please update the version in CMakeLists.txt to a new version.${NC}" + exit 1 +fi +echo -e "${GREEN}Tag '${TAG}' is available${NC}" + +# Check if CHANGELOG.md exists +if [ ! -f "$CHANGELOG_FILE" ]; then + echo -e "${RED}Error: CHANGELOG.md not found${NC}" + exit 1 +fi + +# Check if [Unreleased] section exists +if ! grep -q "## \[Unreleased\]" "$CHANGELOG_FILE"; then + echo -e "${RED}Error: [Unreleased] section not found in CHANGELOG.md${NC}" + exit 1 +fi + +# Get today's date +TODAY=$(date +%Y-%m-%d) + +# Use Python for reliable cross-platform text processing +python3 << EOF +import re +import sys + +version = "${VERSION}" +today = "${TODAY}" + +with open("${CHANGELOG_FILE}", 'r') as f: + content = f.read() + +# Pattern to match [Unreleased] section and its content +pattern = r'(## \[Unreleased\])\n(.*?)(\n## \[)' +match = re.search(pattern, content, re.DOTALL) + +if not match: + print("Error: Could not parse [Unreleased] section") + sys.exit(1) + +unreleased_content = match.group(2).strip() + +# Create new content +new_unreleased = """## [Unreleased] + +### Added + +### Changed + +### Fixed +""" + +new_version_section = f"## [{version}] - {today}" + +if unreleased_content: + new_version_section += f"\n\n{unreleased_content}" + +# Replace the [Unreleased] section with new unreleased + versioned section +new_content = content[:match.start()] + new_unreleased + "\n\n" + new_version_section + "\n" + match.group(3) + content[match.end():] + +with open("${CHANGELOG_FILE}", 'w') as f: + f.write(new_content) + +print("Done") +EOF + +echo -e "${GREEN}CHANGELOG.md updated successfully!${NC}" +echo -e " - Moved [Unreleased] content to [${VERSION}] - ${TODAY}" +echo -e " - Added new empty [Unreleased] section" +echo "" +echo -e "${YELLOW}Next steps:${NC}" +echo " 1. Review CHANGELOG.md changes" +echo " 2. Commit: git add CHANGELOG.md && git commit -m \"Release ${VERSION}\"" +echo " 3. Push to br_release branch"