diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5482c7d4..485a2be0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,15 @@ jobs: strategy: matrix: include: - - os: windows-2019 - name: win-x86 - param: -x86 - - os: windows-2019 - name: win-x64 - param: -x64 - - os: windows-2019 - name: win-arm64 - param: -arm64 + # - os: windows-2019 + # name: win-x86 + # param: -x86 + # - os: windows-2019 + # name: win-x64 + # param: -x64 + # - os: windows-2019 + # name: win-arm64 + # param: -arm64 - os: ubuntu-24.04 name: linux-x64 - os: ubuntu-24.04 @@ -39,10 +39,10 @@ jobs: name: linux-musl-arm - os: ubuntu-24.04 name: linux-musl-arm64 - - os: macos-13 - name: osx-x64 - - os: macos-13 - name: osx-arm64 + # - os: macos-13 + # name: osx-x64 + # - os: macos-13 + # name: osx-arm64 fail-fast: false steps: - name: Checkout @@ -55,9 +55,6 @@ jobs: - name: Build macOS if: runner.os == 'macOS' run: ./build.libgit2.sh - - name: Setup QEMU - if: matrix.name == 'linux-musl-arm' || matrix.name == 'linux-musl-arm64' - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - name: Build Linux if: runner.os == 'Linux' run: ./dockerbuild.sh diff --git a/Dockerfile.linux-musl b/Dockerfile.linux-musl index 1cfa1e4e..46f5c89c 100644 --- a/Dockerfile.linux-musl +++ b/Dockerfile.linux-musl @@ -1,8 +1,18 @@ -ARG ARCH='amd64' -FROM multiarch/alpine:${ARCH}-v3.13 -RUN apk add --no-cache bash build-base cmake +FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx + +FROM --platform=$BUILDPLATFORM alpine + +COPY --from=xx / / + +RUN apk add cmake clang lld bash build-base WORKDIR /nativebinaries COPY . /nativebinaries/ +ARG TARGETPLATFORM +RUN xx-apk add musl-dev gcc pkgconf + +RUN xx-info env +RUN xx-clang --setup-target-triple + CMD ["/bin/bash", "-c", "./build.libgit2.sh"] \ No newline at end of file diff --git a/build.libgit2.sh b/build.libgit2.sh index 3ac9e48e..aeec848a 100755 --- a/build.libgit2.sh +++ b/build.libgit2.sh @@ -33,6 +33,7 @@ cmake -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_OSX_ARCHITECTURES=$OSXARCHITECTURE \ -DUSE_HTTPS=$USEHTTPS \ -DUSE_BUNDLED_ZLIB=ON \ + $(xx-clang --print-cmake-defines) \ .. cmake --build . diff --git a/dockerbuild.sh b/dockerbuild.sh index 4ee5a0a2..c7f34e77 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -19,9 +19,9 @@ else dockerfile="Dockerfile.linux" fi -docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch . +docker buildx build -t $RID -f $dockerfile --platform=linux/$arch --build-arg ARCH=$arch . -docker run -t -e RID=$RID --name=$RID $RID +docker run -t -e RID=$RID --name=$RID --platform=linux/$arch $RID docker cp $RID:/nativebinaries/nuget.package/runtimes nuget.package