diff --git a/.github/workflows/docker-agent-publish.yml b/.github/workflows/docker-agent-publish.yml deleted file mode 100644 index 83d6eab..0000000 --- a/.github/workflows/docker-agent-publish.yml +++ /dev/null @@ -1,150 +0,0 @@ -name: 构建并发布 Agent Docker 镜像 - -on: - push: - tags: - - 'v*' # 当推送以 v 开头的 tag 时触发 - workflow_dispatch: # 允许手动触发 - -env: - # 使用 docker.io 作为 Docker Hub 的注册表 - DOCKER_REGISTRY: docker.io - # 使用 GitHub Container Registry - GHCR_REGISTRY: ghcr.io - # Agent 镜像名称 - IMAGE_NAME: ${{ github.repository }}-agent - -jobs: - build-and-push: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - id-token: write - - steps: - # 获取版本号 - - name: 获取版本号 - id: get_version - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - echo "VERSION=dev" >> $GITHUB_ENV - else - echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - fi - - # 检出代码 - - name: 检出代码 - uses: actions/checkout@v4 - with: - fetch-depth: 0 # 获取完整历史以便计算 AGENT_VERSION - - # 计算 Agent 版本号 - - name: 计算 Agent 版本号 - id: agent_version - run: | - AGENT_VERSION=$(git log -1 --format=%h -- pkg/agent 2>/dev/null || echo "dev") - echo "AGENT_VERSION=$AGENT_VERSION" >> $GITHUB_ENV - echo "Agent version: $AGENT_VERSION" - - # 安装 make 和 upx - - name: 安装 make 和 upx - run: | - sudo apt-get update - sudo apt-get install -y make upx-ucl - - # 设置 Golang - - name: 设置 Golang - uses: actions/setup-go@v5 - with: - go-version: '1.25.0' - - # 构建 agents (release版本使用最佳压缩) - - name: 构建 agents - run: | - make build-agents RELEASE=true - - # 列出编译产物 - - name: 列出编译产物 - run: | - echo "Agent binaries:" - ls -lh ./bin/agents/ - - # 设置 QEMU 支持多平台构建 - - name: 设置 QEMU - uses: docker/setup-qemu-action@v3 - - # 设置 Docker Buildx - - name: 设置 Docker Buildx - uses: docker/setup-buildx-action@v3 - - # 登录 Docker Hub - - name: 登录 Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - # 登录 GitHub Container Registry - - name: 登录 GitHub Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ${{ env.GHCR_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # 提取 Docker 元数据 - - name: 提取 Docker 元数据 - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }} - ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=raw,value=latest - type=raw,value=${{ env.AGENT_VERSION }} - - # 构建并推送 Agent Docker 镜像 - - name: 构建并推送 Agent Docker 镜像 - id: build-and-push - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64,linux/arm64 - file: Dockerfile.agent - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - VERSION=${{ env.VERSION }} - AGENT_VERSION=${{ env.AGENT_VERSION }} - cache-from: | - type=registry,ref=${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:cache - type=local,src=/tmp/.buildx-cache - cache-to: | - type=registry,ref=${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:cache,mode=max - type=local,dest=/tmp/.buildx-cache - - # 生成构建总结 - - name: 生成构建总结 - run: | - echo "## Agent Docker 镜像构建成功 🎉" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**Server 版本:** ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY - echo "**Agent 版本:** ${{ env.AGENT_VERSION }}" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**镜像标签:**" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "**支持平台:**" >> $GITHUB_STEP_SUMMARY - echo "- linux/amd64" >> $GITHUB_STEP_SUMMARY - echo "- linux/arm64" >> $GITHUB_STEP_SUMMARY diff --git a/docker-compose-agent.yaml b/docker-compose-agent.yaml deleted file mode 100644 index 3ef4310..0000000 --- a/docker-compose-agent.yaml +++ /dev/null @@ -1,8 +0,0 @@ -services: - pika-agent: - image: dushixiang/pika-agent:latest - container_name: pika-agent - restart: unless-stopped - network_mode: host - volumes: - - ./pika:/root/.pika/ \ No newline at end of file