release(tagword-codeagent): v1.1.33 — chat_turn 核心抽取 + compact 增量合并修复… #38
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install python.org Python 3.11 (macOS 12+ compatible) | |
| run: | | |
| curl -fsSL -o /tmp/python311.pkg \ | |
| "https://www.python.org/ftp/python/3.11.9/python-3.11.9-macos11.pkg" | |
| sudo installer -pkg /tmp/python311.pkg -target / | |
| - name: Install dependencies | |
| run: | | |
| /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install pillow | |
| - name: Build .app + DMG | |
| run: bash packaging/build_mac_dmg.sh | |
| env: | |
| CODEAGENT_BUILD_PYTHON: /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 | |
| MACOSX_DEPLOYMENT_TARGET: "12.0" | |
| - name: Find DMG file | |
| id: dmg-info | |
| run: | | |
| dmg=$(ls dist/CodeAgent-mac-*.dmg | head -1) | |
| echo "path=$dmg" >> "$GITHUB_OUTPUT" | |
| echo "name=$(basename $dmg)" >> "$GITHUB_OUTPUT" | |
| - name: Upload DMG | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CodeAgent-mac | |
| path: ${{ steps.dmg-info.outputs.path }} | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies (monorepo siblings from GitHub) | |
| shell: pwsh | |
| run: | | |
| python -m pip install --upgrade pip | |
| # MONO = repo root (= parent of packaging/). Same logic as build_mac_dmg.sh | |
| $mono = "${{ github.workspace }}" | |
| # Clone missing monorepo siblings (seed, seed-tools, seed-model-providers) | |
| # The spec file uses collect_all() on these packages + pathex includes MONO/<name> | |
| $siblings = @("seed", "seed-tools", "seed-model-providers") | |
| foreach ($src in $siblings) { | |
| $dir = Join-Path $mono $src | |
| if (-not (Test-Path (Join-Path $dir "pyproject.toml"))) { | |
| Write-Host "==> Clone $src to $dir" | |
| git clone --depth 1 -b main "https://github.com/${{ github.repository_owner }}/${src}.git" $dir | |
| } | |
| } | |
| # Install all monorepo packages (editable, so PyInstaller can find them) | |
| pip install -e "$mono\seed-model-providers" -e "$mono\seed" -e "$mono\seed-tools[code]" -e "$mono" | |
| pip install pyinstaller | |
| # 系统托盘图标 (pystray) + 图像处理 (Pillow) | |
| pip install pystray pillow | |
| env: | |
| GIT_TERMINAL_PROMPT: 0 | |
| - name: Stage bundled tools (git/node/eslint/ast-grep/ruff for Windows) | |
| timeout-minutes: 15 | |
| shell: pwsh | |
| run: | | |
| python packaging/prepare_bundle_tools.py 2>&1 | Tee-Object -FilePath "$env:RUNNER_TEMP\stage-tools.log" | |
| if ($LASTEXITCODE -ne 0) { | |
| "::error::===== stage-tools.log (tail 40) =====" | |
| Get-Content "$env:RUNNER_TEMP\stage-tools.log" -Tail 40 | ForEach-Object { "::error::$_" } | |
| exit $LASTEXITCODE | |
| } | |
| - name: Upload stage diagnostics (always) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: stage-tools-diag | |
| if-no-files-found: ignore | |
| path: | | |
| ${{ runner.temp }}\stage-tools.log | |
| packaging/build/bundle-tools/TOOLS.txt | |
| - name: Build with PyInstaller (Windows spec) | |
| run: pyinstaller packaging/CodeAgent.windows.spec --distpath dist | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CodeAgent-win | |
| path: dist/CodeAgent.exe | |
| build-docker: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - 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.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract version tag | |
| id: meta | |
| run: | | |
| echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| echo "image=ghcr.io/${{ github.repository_owner }}/codeagent" >> "$GITHUB_OUTPUT" | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: | | |
| ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }} | |
| ${{ steps.meta.outputs.image }}:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: [build-macos, build-windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: read | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: CodeAgent-mac | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: CodeAgent-win | |
| - name: Prepare release files | |
| run: | | |
| mkdir -p "${{ github.workspace }}"/dist/ | |
| dmg_file=$(find "${{ github.workspace }}" -maxdepth 1 -name "*.dmg" | head -1) | |
| if [ -z "$dmg_file" ]; then | |
| echo "ERROR: No .dmg file found in workspace" | |
| exit 1 | |
| fi | |
| echo "Found DMG: $dmg_file" | |
| cp "$dmg_file" "${{ github.workspace }}"/dist/ | |
| if [ -f "${{ github.workspace }}"/CodeAgent.exe ]; then | |
| cp "${{ github.workspace }}"/CodeAgent.exe "${{ github.workspace }}"/dist/ | |
| else | |
| echo "ERROR: CodeAgent.exe not found in workspace" | |
| exit 1 | |
| fi | |
| echo "=== dist/ contents ===" | |
| ls -la "${{ github.workspace }}"/dist/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/CodeAgent-mac-*.dmg | |
| dist/CodeAgent.exe | |
| generate_release_notes: true |