Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ jobs:
runs-on: ${{ matrix.os }}
env:
RID: ${{ matrix.name }}
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
strategy:
matrix:
include:
- os: windows-2019
- os: windows-2022
name: win-x86
param: -x86
- os: windows-2019
- os: windows-2022
name: win-x64
param: -x64
- os: windows-2019
- os: windows-2022
name: win-arm64
param: -arm64
- os: ubuntu-24.04
Expand All @@ -39,14 +40,14 @@ jobs:
name: linux-musl-arm
- os: ubuntu-24.04
name: linux-musl-arm64
- os: macos-13
- os: macos-26-intel
name: osx-x64
- os: macos-13
- os: macos-26
name: osx-arm64
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6.0.2
with:
submodules: true
- name: Build Windows
Expand All @@ -56,13 +57,16 @@ jobs:
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
if: runner.os == 'Linux' && (matrix.name == 'linux-arm' || matrix.name == 'linux-arm64' || matrix.name == 'linux-ppc64le' || matrix.name == 'linux-musl-arm' || matrix.name == 'linux-musl-arm64')
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
if: runner.os == 'Linux'
uses: docker/setup-buildx-action@v4
- name: Build Linux
if: runner.os == 'Linux'
run: ./dockerbuild.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4.4.3
uses: actions/upload-artifact@v7.0.0
with:
name: ${{ matrix.name }}
path: nuget.package/runtimes/${{ matrix.name }}
Expand All @@ -72,23 +76,24 @@ jobs:
runs-on: ubuntu-24.04
env:
DOTNET_NOLOGO: true
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4.1.0
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: 9.0.x
- name: Download artifacts
uses: actions/download-artifact@v4.1.8
uses: actions/download-artifact@v8.0.1
with:
path: nuget.package/runtimes/
- name: Create package
run: dotnet pack nuget.package
- name: Upload NuGet package
uses: actions/upload-artifact@v4.4.3
uses: actions/upload-artifact@v7.0.0
with:
name: NuGet package
path: ./nuget.package/*.nupkg
15 changes: 10 additions & 5 deletions Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
FROM bording/crossbuild
ARG ARCH='amd64'
ENV CROSS_TRIPLE=${ARCH}
RUN apt update && apt -y install pkg-config
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
pkg-config \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /nativebinaries
COPY . /nativebinaries/

CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
6 changes: 3 additions & 3 deletions Dockerfile.linux-musl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG ARCH='amd64'
FROM multiarch/alpine:${ARCH}-v3.13
FROM alpine:3.19

RUN apk add --no-cache bash build-base cmake

WORKDIR /nativebinaries
COPY . /nativebinaries/

CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
13 changes: 7 additions & 6 deletions dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
set -e
echo "building for $RID"

# Map RID to Docker platform for native builds (no cross-compilation).
if [[ $RID =~ arm64 ]]; then
arch="arm64"
platform="linux/arm64"
elif [[ $RID =~ arm ]]; then
arch="armhf"
platform="linux/arm/v7"
elif [[ $RID =~ ppc64le ]]; then
arch="powerpc64le"
platform="linux/ppc64le"
else
arch="amd64"
platform="linux/amd64"
fi

if [[ $RID == linux-musl* ]]; then
Expand All @@ -19,9 +20,9 @@ else
dockerfile="Dockerfile.linux"
fi

docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch .
docker buildx build --platform "$platform" --load -t $RID -f $dockerfile .

docker run -t -e RID=$RID --name=$RID $RID
docker run --platform "$platform" -t -e RID=$RID --name=$RID $RID

docker cp $RID:/nativebinaries/nuget.package/runtimes nuget.package

Expand Down
2 changes: 1 addition & 1 deletion libgit2
Submodule libgit2 updated 444 files
4 changes: 2 additions & 2 deletions nuget.package/build/LibGit2Sharp.NativeBinaries.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<libgit2_propsfile>$(MSBuildThisFileFullPath)</libgit2_propsfile>
<libgit2_hash>3f4182d15eab74a302718f2de454ffadb1995626</libgit2_hash>
<libgit2_filename>git2-3f4182d</libgit2_filename>
<libgit2_hash>ca225744b992bf2bf24e9a2eb357ddef78179667</libgit2_hash>
<libgit2_filename>git2-ca22574</libgit2_filename>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions nuget.package/build/net46/LibGit2Sharp.NativeBinaries.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<libgit2_propsfile>$(MSBuildThisFileFullPath)</libgit2_propsfile>
<libgit2_hash>3f4182d15eab74a302718f2de454ffadb1995626</libgit2_hash>
<libgit2_filename>git2-3f4182d</libgit2_filename>
<libgit2_hash>ca225744b992bf2bf24e9a2eb357ddef78179667</libgit2_hash>
<libgit2_filename>git2-ca22574</libgit2_filename>
</PropertyGroup>
<ItemGroup>
<ContentWithTargetPath Include="$(MSBuildThisFileDirectory)\..\..\runtimes\win-x86\native\*" TargetPath="lib\win32\x86\%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
Expand Down
12 changes: 6 additions & 6 deletions nuget.package/libgit2/LibGit2Sharp.dll.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<configuration>
<dllmap os="linux" cpu="x86-64" wordsize="64" dll="git2-3f4182d" target="lib/linux-x64/libgit2-3f4182d.so" />
<dllmap os="linux" cpu="arm" wordsize="32" dll="git2-3f4182d" target="lib/linux-arm/libgit2-3f4182d.so" />
<dllmap os="linux" cpu="armv8" wordsize="64" dll="git2-3f4182d" target="lib/linux-arm64/libgit2-3f4182d.so" />
<dllmap os="linux" cpu="ppc64le" wordsize="64" dll="git2-3f4182d" target="lib/linux-ppc64le/libgit2-3f4182d.so" />
<dllmap os="osx" cpu="x86-64" wordsize="64" dll="git2-3f4182d" target="lib/osx-x64/libgit2-3f4182d.dylib" />
<dllmap os="osx" cpu="armv8" wordsize="64" dll="git2-3f4182d" target="lib/osx-arm64/libgit2-3f4182d.dylib" />
<dllmap os="linux" cpu="x86-64" wordsize="64" dll="git2-ca22574" target="lib/linux-x64/libgit2-ca22574.so" />
<dllmap os="linux" cpu="arm" wordsize="32" dll="git2-ca22574" target="lib/linux-arm/libgit2-ca22574.so" />
<dllmap os="linux" cpu="armv8" wordsize="64" dll="git2-ca22574" target="lib/linux-arm64/libgit2-ca22574.so" />
<dllmap os="linux" cpu="ppc64le" wordsize="64" dll="git2-ca22574" target="lib/linux-ppc64le/libgit2-ca22574.so" />
<dllmap os="osx" cpu="x86-64" wordsize="64" dll="git2-ca22574" target="lib/osx-x64/libgit2-ca22574.dylib" />
<dllmap os="osx" cpu="armv8" wordsize="64" dll="git2-ca22574" target="lib/osx-arm64/libgit2-ca22574.dylib" />
</configuration>
2 changes: 1 addition & 1 deletion nuget.package/libgit2/libgit2_hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3f4182d15eab74a302718f2de454ffadb1995626
ca225744b992bf2bf24e9a2eb357ddef78179667
Loading