Add GitHub Actions workflow for npm and Docker publishing and update README

This commit is contained in:
stabgan
2025-03-27 00:48:01 +05:30
parent a9301b65eb
commit 4590590ad0
2 changed files with 119 additions and 1 deletions

100
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,100 @@
name: Build, Test and Publish
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Run tests
run: npm test || echo "No tests found"
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
publish-npm:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
docker:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: stabgandocker/openrouter-mcp-multimodal
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=ref,event=branch
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -1,5 +1,9 @@
# OpenRouter MCP Multimodal Server # OpenRouter MCP Multimodal Server
[![Build Status](https://github.com/stabgan/openrouter-mcp-multimodal/actions/workflows/publish.yml/badge.svg)](https://github.com/stabgan/openrouter-mcp-multimodal/actions/workflows/publish.yml)
[![npm version](https://img.shields.io/npm/v/@stabgan/openrouter-mcp-multimodal.svg)](https://www.npmjs.com/package/@stabgan/openrouter-mcp-multimodal)
[![Docker Pulls](https://img.shields.io/docker/pulls/stabgandocker/openrouter-mcp-multimodal.svg)](https://hub.docker.com/r/stabgandocker/openrouter-mcp-multimodal)
An MCP (Model Context Protocol) server that provides chat and image analysis capabilities through OpenRouter.ai's diverse model ecosystem. This server combines text chat functionality with powerful image analysis capabilities. An MCP (Model Context Protocol) server that provides chat and image analysis capabilities through OpenRouter.ai's diverse model ecosystem. This server combines text chat functionality with powerful image analysis capabilities.
## Features ## Features
@@ -26,6 +30,20 @@ An MCP (Model Context Protocol) server that provides chat and image analysis cap
- Exponential backoff for retries - Exponential backoff for retries
- Automatic rate limit handling - Automatic rate limit handling
## Installation
### Option 1: Install via npm
```bash
npm install -g @stabgan/openrouter-mcp-multimodal
```
### Option 2: Run via Docker
```bash
docker run -i -e OPENROUTER_API_KEY=your-api-key-here stabgandocker/openrouter-mcp-multimodal:latest
```
## Quick Start Configuration ## Quick Start Configuration
### Prerequisites ### Prerequisites
@@ -91,7 +109,7 @@ Add one of the following configurations to your MCP settings file (e.g., `cline_
"-i", "-i",
"-e", "OPENROUTER_API_KEY=your-api-key-here", "-e", "OPENROUTER_API_KEY=your-api-key-here",
"-e", "OPENROUTER_DEFAULT_MODEL=anthropic/claude-3.5-sonnet", "-e", "OPENROUTER_DEFAULT_MODEL=anthropic/claude-3.5-sonnet",
"stabgan/openrouter-mcp-multimodal:latest" "stabgandocker/openrouter-mcp-multimodal:latest"
] ]
} }
} }