From d1693bc91820bbfd9bce2a7e6824bf743e081b8c Mon Sep 17 00:00:00 2001 From: zhaoyanchao Date: Tue, 28 Apr 2026 14:05:14 +0800 Subject: [PATCH] =?UTF-8?q?ci(release):=20=E6=B7=BB=E5=8A=A0musl=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=9B=AE=E6=A0=87=E5=B9=B6=E4=BC=98=E5=8C=96Linux?= =?UTF-8?q?=E4=BA=8C=E8=BF=9B=E5=88=B6=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为Linux构建添加musl目标以提升兼容性 - 为macOS ARM64添加明确的构建目标 - 添加musl-tools安装步骤用于Linux环境 - 更新构建路径以适配目标架构目录结构 - 对Linux二进制文件执行strip操作减小体积 --- .github/workflows/release.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 682a983c..7c339c05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,31 +28,42 @@ jobs: os: ubuntu-latest bin: claw artifact_name: claw-linux-x64 + target: x86_64-unknown-linux-musl - name: macos-arm64 os: macos-14 bin: claw artifact_name: claw-macos-arm64 + target: aarch64-apple-darwin defaults: run: working-directory: rust steps: - uses: actions/checkout@v4 + - name: Install musl-tools (Linux only) + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get update && sudo apt-get install -y musl-tools + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} - uses: Swatinem/rust-cache@v2 with: workspaces: rust -> target - name: Build release binary - run: cargo build --release -p rusty-claude-cli + run: cargo build --release -p rusty-claude-cli --target ${{ matrix.target }} - name: Package artifact shell: bash run: | mkdir -p dist - cp "target/release/${{ matrix.bin }}" "dist/${{ matrix.artifact_name }}" + cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "dist/${{ matrix.artifact_name }}" chmod +x "dist/${{ matrix.artifact_name }}" + if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then + strip "dist/${{ matrix.artifact_name }}" + fi - name: Upload workflow artifact uses: actions/upload-artifact@v4