feat: add manual Docker release workflow (#187)

- 新增 docker-release.yml workflow,支持手动触发 Docker 镜像构建
- 从 release.yml 中移除自动 Docker 构建,避免镜像膨胀
- 使用语义化版本号策略(如 v1.0.0)
- 支持多平台构建(linux/amd64, linux/arm64)
- 硬编码公开信息,只需配置 DOCKERHUB_TOKEN secret
- 自动标记版本号和 latest 标签

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
zy
2025-09-30 01:42:37 +08:00
committed by GitHub
parent 85852e3277
commit 4d809f1e84
5 changed files with 147 additions and 103 deletions

40
.github/workflows/docker-release.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Docker Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.0.0)'
required: true
default: 'v1.0.0'
permissions:
contents: read
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: xpzouying
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
xpzouying/xiaohongshu-mcp:${{ github.event.inputs.version }}
xpzouying/xiaohongshu-mcp:latest
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -142,6 +142,10 @@ jobs:
./xiaohongshu-mcp-darwin-arm64
```
### 🐳 Docker 镜像
Docker 镜像需要手动触发构建,请到 Actions 页面运行 "Docker Release" workflow。
### 📊 构建信息
- **Commit**: ${{ github.sha }}

View File

@@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/go-rod/rod"
"github.com/mattn/go-runewidth"
"github.com/sirupsen/logrus"
@@ -14,6 +13,7 @@ import (
"github.com/xpzouying/xiaohongshu-mcp/cookies"
"github.com/xpzouying/xiaohongshu-mcp/pkg/downloader"
"github.com/xpzouying/xiaohongshu-mcp/xiaohongshu"
"os"
"time"
)