ad17f9dba6
- Add final job that displays copy-paste registration commands - Shows Claude Code, Windsurf, and VS Code/Cursor commands - Includes release URLs and success banner
215 lines
7.3 KiB
YAML
215 lines
7.3 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version tag (e.g., v1.31.0)'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Build release binary
|
|
run: cargo build --release
|
|
|
|
- name: Package binary
|
|
run: |
|
|
mkdir -p dist/mt5-quant-macos
|
|
cp target/release/mt5-quant dist/mt5-quant-macos/
|
|
cp -r config dist/mt5-quant-macos/
|
|
cp README.md dist/mt5-quant-macos/
|
|
cp -r docs dist/mt5-quant-macos/
|
|
cd dist
|
|
tar -czf mt5-quant-macos-arm64.tar.gz mt5-quant-macos
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-binary
|
|
path: dist/mt5-quant-macos-arm64.tar.gz
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Build release binary
|
|
run: cargo build --release
|
|
|
|
- name: Package binary
|
|
run: |
|
|
mkdir -p dist/mt5-quant-linux
|
|
cp target/release/mt5-quant dist/mt5-quant-linux/
|
|
cp -r config dist/mt5-quant-linux/
|
|
cp README.md dist/mt5-quant-linux/
|
|
cp -r docs dist/mt5-quant-linux/
|
|
cd dist
|
|
tar -czf mt5-quant-linux-x64.tar.gz mt5-quant-linux
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-binary
|
|
path: dist/mt5-quant-linux-x64.tar.gz
|
|
|
|
release:
|
|
needs: [build-macos, build-linux]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download macOS artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: macos-binary
|
|
path: dist
|
|
|
|
- name: Download Linux artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: linux-binary
|
|
path: dist
|
|
|
|
- name: Create or Update GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.event.inputs.version || github.ref_name }}
|
|
name: ${{ github.event.inputs.version || github.ref_name }}
|
|
files: |
|
|
dist/mt5-quant-macos-arm64.tar.gz
|
|
dist/mt5-quant-linux-x64.tar.gz
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-mcp-package:
|
|
needs: release
|
|
runs-on: macos-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download macOS artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: macos-binary
|
|
path: dist
|
|
|
|
- name: Build MCP package
|
|
run: |
|
|
# Create MCP package structure
|
|
mkdir -p mcp-package/mcp-server/bin
|
|
|
|
# Extract binary from the tar.gz
|
|
cd dist
|
|
tar -xzf mt5-quant-macos-arm64.tar.gz
|
|
cp mt5-quant-macos/mt5-quant ../mcp-package/mcp-server/bin/
|
|
cd ..
|
|
|
|
# Copy config and docs
|
|
cp -r config mcp-package/
|
|
cp -r docs mcp-package/
|
|
cp README.md mcp-package/
|
|
cp server.json mcp-package/
|
|
|
|
# Create tar.gz
|
|
cd mcp-package
|
|
tar -czf ../mcp-mt5-quant-macos-arm64.tar.gz .
|
|
cd ..
|
|
|
|
# Calculate SHA256
|
|
shasum -a 256 mcp-mt5-quant-macos-arm64.tar.gz | awk '{print $1}' > mcp-sha256.txt
|
|
echo "MCP Package SHA256: $(cat mcp-sha256.txt)"
|
|
|
|
- name: Upload MCP package to release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.event.inputs.version || github.ref_name }}
|
|
files: |
|
|
mcp-mt5-quant-macos-arm64.tar.gz
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload MCP package artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: mcp-package
|
|
path: mcp-mt5-quant-macos-arm64.tar.gz
|
|
|
|
mcp-publish:
|
|
needs: build-mcp-package
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Download MCP package
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: mcp-package
|
|
path: .
|
|
|
|
- name: Install mcp-publisher
|
|
run: |
|
|
curl -L -o mcp-publisher https://github.com/modelcontextprotocol/mcp-publisher/releases/latest/download/mcp-publisher-linux-amd64
|
|
chmod +x mcp-publisher
|
|
sudo mv mcp-publisher /usr/local/bin/
|
|
|
|
- name: Publish to MCP Registry
|
|
run: |
|
|
echo "=== MCP Registry Publish ==="
|
|
# Login with pre-authenticated token
|
|
echo "${{ secrets.MCP_PUBLISH_TOKEN }}" | mcp-publisher login github --token-stdin
|
|
|
|
# Publish the server
|
|
mcp-publisher publish
|
|
|
|
echo "✓ Published to MCP Registry"
|
|
|
|
release-info:
|
|
needs: [mcp-publish]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Display Release Commands
|
|
run: |
|
|
echo ""
|
|
echo "╔════════════════════════════════════════════════════════════════╗"
|
|
echo "║ 🎉 RELEASE COMPLETED SUCCESSFULLY! 🎉 ║"
|
|
echo "╚════════════════════════════════════════════════════════════════╝"
|
|
echo ""
|
|
echo "📦 GitHub Release: https://github.com/masdevid/mt5-quant/releases/tag/${{ github.event.inputs.version || github.ref_name }}"
|
|
echo "📦 MCP Registry: io.github.masdevid/mt5-quant"
|
|
echo ""
|
|
echo "═══════════════════════════════════════════════════════════════════"
|
|
echo " MCP CLIENT REGISTRATION COMMANDS"
|
|
echo "═══════════════════════════════════════════════════════════════════"
|
|
echo ""
|
|
echo "▶️ CLAUDE CODE:"
|
|
echo " claude mcp add io.github.masdevid/mt5-quant -- ~/.local/bin/mt5-quant"
|
|
echo ""
|
|
echo "▶️ WINDSURF:"
|
|
echo ' echo \'{"mcpServers": {"io.github.masdevid/mt5-quant": {"command": "~/.local/bin/mt5-quant", "disabled": false, "registry": "io.github.masdevid/mt5-quant"}}}\' >> ~/.codeium/windsurf/mcp_config.json'
|
|
echo ""
|
|
echo "▶️ CURSOR / VSCODE:"
|
|
echo ' mkdir -p ~/.cursor && echo \'{"mcpServers": {"mt5-quant": {"command": "~/.local/bin/mt5-quant"}}}\' > ~/.cursor/mcp.json'
|
|
echo ""
|
|
echo "═══════════════════════════════════════════════════════════════════"
|