diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 16c2c540..aada206c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,12 +33,16 @@ jobs:
name: linux-arm64
- os: ubuntu-24.04
name: linux-ppc64le
+ - os: ubuntu-24.04
+ name: linux-riscv64
- os: ubuntu-24.04
name: linux-musl-x64
- os: ubuntu-24.04
name: linux-musl-arm
- os: ubuntu-24.04
name: linux-musl-arm64
+ - os: ubuntu-24.04
+ name: linux-musl-riscv64
- os: macos-14
name: osx-x64
- os: macos-14
@@ -56,8 +60,8 @@ 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: startsWith(matrix.name, 'linux-musl-')
+ run: docker run --privileged --rm tonistiigi/binfmt --install all
- name: Build Linux
if: runner.os == 'Linux'
run: ./dockerbuild.sh
diff --git a/README.md b/README.md
index a6f68879..2b0e1131 100644
--- a/README.md
+++ b/README.md
@@ -12,8 +12,8 @@ the following platforms:
- Windows (x86, x64, arm64)
- macOS (x64, arm64)
- Linux
- - glibc: (x64, arm, arm64, ppc64le)
- - musl: (x64, arm, arm64)
+ - glibc: (x64, arm, arm64, ppc64le, riscv64)
+ - musl: (x64, arm, arm64, riscv64)
[lg2s-nb]: https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries
[lg2]: https://libgit2.github.com/
diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1
index a3111d3d..00ca2ace 100644
--- a/UpdateLibgit2ToSha.ps1
+++ b/UpdateLibgit2ToSha.ps1
@@ -124,6 +124,7 @@ Push-Location $libgit2Directory
+
diff --git a/docker/musl b/docker/musl
index 1cfa1e4e..4d02bb82 100644
--- a/docker/musl
+++ b/docker/musl
@@ -1,8 +1,10 @@
ARG ARCH='amd64'
-FROM multiarch/alpine:${ARCH}-v3.13
+ARG ALPINE_VERSION='3.13'
+
+FROM alpine:${ALPINE_VERSION}
RUN apk add --no-cache bash build-base cmake
WORKDIR /nativebinaries
COPY . /nativebinaries/
-CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
\ No newline at end of file
+CMD ["/bin/bash", "-c", "./build.libgit2.sh"]
diff --git a/dockerbuild.sh b/dockerbuild.sh
index c42fa150..efe31181 100755
--- a/dockerbuild.sh
+++ b/dockerbuild.sh
@@ -3,12 +3,17 @@
set -e
echo "building for $RID"
+alpineVersion=3.13
+
if [[ $RID =~ arm64 ]]; then
arch="arm64"
elif [[ $RID =~ arm ]]; then
arch="armhf"
elif [[ $RID =~ ppc64le ]]; then
arch="powerpc64le"
+elif [[ $RID =~ riscv64 ]]; then
+ arch="riscv64"
+ alpineVersion=3.20 # alpine 3.20 is the first version with official riscv64 support
else
arch="amd64"
fi
@@ -19,9 +24,9 @@ else
dockerfile="docker/linux"
fi
-docker buildx build -t $RID -f $dockerfile --build-arg ARCH=$arch .
+docker build --no-cache --platform linux/$arch -t $RID -f $dockerfile --build-arg ARCH=$arch --build-arg ALPINE_VERSION=$alpineVersion .
-docker run -t -e RID=$RID --name=$RID $RID
+docker run -t --platform linux/$arch -e RID=$RID --name=$RID $RID
docker cp $RID:/nativebinaries/nuget.package/runtimes nuget.package
diff --git a/nuget.package/libgit2/LibGit2Sharp.dll.config b/nuget.package/libgit2/LibGit2Sharp.dll.config
index 95f4b0bc..25074a9a 100644
--- a/nuget.package/libgit2/LibGit2Sharp.dll.config
+++ b/nuget.package/libgit2/LibGit2Sharp.dll.config
@@ -3,6 +3,7 @@
+