diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54837ac35..5a83f6b58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,14 +32,15 @@ jobs: retention-days: 7 - name: Verify trimming compatibility run: dotnet publish TrimmingTestApp + test: name: Test / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ matrix.tfm }} runs-on: ${{ matrix.os }} strategy: matrix: arch: [ x64 ] - os: [ windows-2019, windows-2022, macos-13 ] - tfm: [ net472, net8.0, net9.0 ] + os: [ windows-2022, macos-13 ] + tfm: [ net472, net6.0, net8.0, net9.0 ] exclude: - os: macos-13 tfm: net472 @@ -62,6 +63,7 @@ jobs: dotnet-version: | 9.0.x 8.0.x + 6.0.x - name: Run ${{ matrix.tfm }} tests run: dotnet test LibGit2Sharp.sln --configuration Release --framework ${{ matrix.tfm }} --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING test-linux: @@ -80,6 +82,8 @@ jobs: - distro: alpine.3.19 sdk: '9.0' include: + - sdk: '6.0' + tfm: net6.0 - sdk: '8.0' tfm: net8.0 - sdk: '9.0' @@ -99,4 +103,21 @@ jobs: git_command="git config --global --add safe.directory /app" test_command="dotnet test LibGit2Sharp.sln --configuration Release -p:TargetFrameworks=${{ matrix.tfm }} --logger "GitHubActions" -p:ExtraDefine=LEAKS_IDENTIFYING" docker run -t --rm --platform linux/${{ matrix.arch }} -v "$PWD:/app" -e OPENSSL_ENABLE_SHA1_SIGNATURES=1 gittools/build-images:${{ matrix.distro }}-sdk-${{ matrix.sdk }} sh -c "$git_command && $test_command" - + + nuget-push: + name: Octopus NuGet Push + needs: [build, test, test-linux] + # && github.ref == 'refs/heads/octopus/master' + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.event_name != 'schedule' + runs-on: ubuntu-22.04 + steps: + - uses: actions/download-artifact@v4 + with: + path: staging + - name: Push package to feed 🐙 + id: push-feed + shell: bash + env: + FEED_API_KEY: ${{ secrets.FEED_API_KEY }} + FEED_SOURCE: ${{ secrets.FEED_SOURCE }} + run: dotnet nuget push staging/**/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" \ No newline at end of file diff --git a/.idea/.idea.LibGit2Sharp/.idea/.gitignore b/.idea/.idea.LibGit2Sharp/.idea/.gitignore new file mode 100644 index 000000000..b3c268b2e --- /dev/null +++ b/.idea/.idea.LibGit2Sharp/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/contentModel.xml +/projectSettingsUpdater.xml +/modules.xml +/.idea.LibGit2Sharp.iml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.LibGit2Sharp/.idea/.name b/.idea/.idea.LibGit2Sharp/.idea/.name new file mode 100644 index 000000000..1bd867fe1 --- /dev/null +++ b/.idea/.idea.LibGit2Sharp/.idea/.name @@ -0,0 +1 @@ +LibGit2Sharp \ No newline at end of file diff --git a/.idea/.idea.LibGit2Sharp/.idea/encodings.xml b/.idea/.idea.LibGit2Sharp/.idea/encodings.xml new file mode 100644 index 000000000..df87cf951 --- /dev/null +++ b/.idea/.idea.LibGit2Sharp/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.LibGit2Sharp/.idea/indexLayout.xml b/.idea/.idea.LibGit2Sharp/.idea/indexLayout.xml new file mode 100644 index 000000000..7b08163ce --- /dev/null +++ b/.idea/.idea.LibGit2Sharp/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.LibGit2Sharp/.idea/vcs.xml b/.idea/.idea.LibGit2Sharp/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/.idea.LibGit2Sharp/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index fb81a76a3..e769ab3df 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -1,7 +1,7 @@  - net472;net8.0;net9.0 + net472;net6.0;net8.0;net9.0 diff --git a/LibGit2Sharp/Core/Ensure.cs b/LibGit2Sharp/Core/Ensure.cs index cd681e4ba..87129e0bd 100644 --- a/LibGit2Sharp/Core/Ensure.cs +++ b/LibGit2Sharp/Core/Ensure.cs @@ -148,7 +148,7 @@ private static unsafe void HandleError(int result) Func exceptionBuilder; if (!GitErrorsToLibGit2SharpExceptions.TryGetValue((GitErrorCode)result, out exceptionBuilder)) { - exceptionBuilder = (m, c) => new LibGit2SharpException(m, c); + exceptionBuilder = (m, c) => new LibGit2SharpException(m); } throw exceptionBuilder(errorMessage, errorCategory); diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 1c4abef7b..611798631 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,7 +1,7 @@  - net472;net8.0 + net472;net8.0;net6.0 12.0 true LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET @@ -19,14 +19,18 @@ App_Readme/README.md App_Readme/LICENSE.md true + Octopus.LibGit2Sharp $(ArtifactsPath)\package - preview.0 + octopus.0 libgit2-$(libgit2_hash.Substring(0,7)) true + + true + diff --git a/LibGit2Sharp/SmartSubtransportStream.cs b/LibGit2Sharp/SmartSubtransportStream.cs index 008d1fcd0..247e90f34 100644 --- a/LibGit2Sharp/SmartSubtransportStream.cs +++ b/LibGit2Sharp/SmartSubtransportStream.cs @@ -119,6 +119,10 @@ private static int SetError(SmartSubtransportStream stream, Exception caught) { errorCode = ((NativeException)ret).ErrorCode; } + else + { + Proxy.git_error_set_str(GitErrorCategory.Unknown, caught); + } return (int)errorCode; }