Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 63 additions & 57 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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-<platform>.tar.gz
./verify_mcp # Test the library
\`\`\`

### Windows
\`\`\`powershell
Expand-Archive libgopher-mcp-windows-<arch>.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}"

Expand All @@ -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: |
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion docker-mcp/Dockerfile.linux-arm64-cross
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docker-mcp/Dockerfile.linux-x64
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docker-mcp/Dockerfile.windows-arm64-llvm
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docker-mcp/Dockerfile.windows-x64
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docker-mcp/build-mac-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-mcp/build-mac-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
111 changes: 111 additions & 0 deletions dump-version.sh
Original file line number Diff line number Diff line change
@@ -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"