name: 🚀 Release and Build Docker
on:
push:
tags:
- 'v*' # 当推送以 v 开头的标签时触发
workflow_dispatch: # 允许手动触发
# 设置 GITHUB_TOKEN 的权限
permissions:
contents: write # 创建 Release 需要
packages: write # 推送 Docker 镜像需要
jobs:
test:
name: 🧪 Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 📦 Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: 📥 Install dependencies
run: uv sync --dev
- name: 🧪 Quick validation
run: |
uv run python -c "
import seedream_mcp
from seedream_mcp.config import SeedreamConfig
from seedream_mcp.server import mcp, SERVER_VERSION, cli_main
from seedream_mcp.client import SeedreamClient
from seedream_mcp.tools import TextToImageInput, ImageToImageInput
print('✅ 核心模块导入测试通过')
print(f'📦 版本: {SERVER_VERSION}')
print('Package validation successful')
"
- name: 🔍 Check package build
run: uv build --wheel
build-and-release:
name: 🏗️ Build and Release
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🏷️ Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: |
## 🚀 Seedream MCP ${{ github.ref_name }}
### ✨ 新特性
请查看 [GitHub Commits](https://github.com/tengmmvp/Seedream_MCP/commits)
### 🛠️ 安装方式
#### 推荐方式(uvx 一键安装)
```bash
uvx run git+https://github.com/tengmmvp/Seedream_MCP --api-key your_api_key_here
```
#### Docker Compose 运行
```bash
curl -O https://raw.githubusercontent.com/tengmmvp/Seedream_MCP/main/docker-compose.yml
ARK_API_KEY=your_api_key_here docker-compose up -d
```
### 🔧 配置说明
1. 获取火山引擎 API 密钥
2. 直接传递 API 密钥参数
3. 在 Claude Desktop 中配置
draft: false
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-release:
name: 🐳 Docker Release
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🏷️ Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 🐳 Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🏷️ Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: 🐳 Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max