diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a45aabda..f3d537622 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,15 +29,15 @@ jobs: matrix: include: - os: ubuntu-22.04 - target: x86_64-unknown-linux-gnu + target: x86_64-unknown-linux-musl artifact_name: git-ai-linux-x64 use_docker: true - docker_image: ubuntu:20.04 + docker_image: ubuntu:22.04 - os: ubuntu-22.04-arm - target: aarch64-unknown-linux-gnu + target: aarch64-unknown-linux-musl artifact_name: git-ai-linux-arm64 use_docker: true - docker_image: ubuntu:20.04 + docker_image: ubuntu:22.04 - os: windows-latest target: x86_64-pc-windows-msvc artifact_name: git-ai-windows-x64 @@ -75,7 +75,7 @@ jobs: ${{ matrix.docker_image }} \ bash -c " apt-get update && \ - apt-get install -y curl build-essential pkg-config libssl-dev && \ + apt-get install -y curl build-essential pkg-config musl-tools && \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --target ${{ matrix.target }} && \ . \$HOME/.cargo/env && \ cargo build --release --target ${{ matrix.target }} && \ @@ -126,9 +126,14 @@ jobs: if: contains(matrix.os, 'ubuntu') run: | file target/${{ matrix.target }}/release/git-ai - ldd target/${{ matrix.target }}/release/git-ai || true - echo "Required GLIBC version:" - objdump -T target/${{ matrix.target }}/release/git-ai | grep GLIBC | sed 's/.*GLIBC_/GLIBC_/' | sort -V | uniq | tail -1 + # Verify the binary is statically linked (musl) + if ldd target/${{ matrix.target }}/release/git-ai 2>&1 | grep -q 'not a dynamic executable\|statically linked'; then + echo "Binary is statically linked (musl) - no GLIBC dependency" + else + echo "::error::Binary is dynamically linked - expected static musl binary" + ldd target/${{ matrix.target }}/release/git-ai || true + exit 1 + fi - name: Verify binary architecture (Windows) if: contains(matrix.os, 'windows') diff --git a/install.sh b/install.sh index 3bd9d8b8c..2fa17a5d3 100755 --- a/install.sh +++ b/install.sh @@ -186,6 +186,7 @@ STD_GIT_PATH=$(detect_std_git) OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) + # Map architecture to binary name case $ARCH in "x86_64")