diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 54837ac35..6f744467b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,6 +7,8 @@ on:
- '[0-9]+.[0-9]+.[0-9]+-*'
pull_request:
workflow_dispatch:
+ schedule:
+ - cron: '0 15 * * *' # Run at 3 PM UTC (1 AM Melbourne AEST / 2 AM AEDT)
env:
DOTNET_NOLOGO: true
jobs:
@@ -23,7 +25,21 @@ jobs:
with:
dotnet-version: 9.0.x
- name: Build
- run: dotnet build LibGit2Sharp.sln --configuration Release
+ run: |
+ # if it is a pull request build set the build identity to branchname.runnumber
+ if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") {
+ $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
+
+ $env:BUILD_IDENTITY = "$branchName.${{ github.run_number }}"
+ }
+
+ # if it is a scheduled build set the build identity to nightly
+ if ("${{ github.event_name }}" -eq "schedule") {
+ $env:BUILD_IDENTITY = "nightly.${{ github.run_number }}"
+ }
+
+ dotnet build LibGit2Sharp.sln --configuration Release
+ shell: pwsh
- name: Upload packages
uses: actions/upload-artifact@v4.3.1
with:
@@ -32,16 +48,17 @@ 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 ]
+ os: [ windows-2022, macos-14 ]
tfm: [ net472, net8.0, net9.0 ]
exclude:
- - os: macos-13
+ - os: macos-14
tfm: net472
include:
- arch: arm64
@@ -99,4 +116,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]'
+ 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..5305e7e2f 100644
--- a/LibGit2Sharp/LibGit2Sharp.csproj
+++ b/LibGit2Sharp/LibGit2Sharp.csproj
@@ -19,8 +19,9 @@
App_Readme/README.md
App_Readme/LICENSE.md
true
+ Octopus.LibGit2Sharp
$(ArtifactsPath)\package
- preview.0
+ octopus.0
libgit2-$(libgit2_hash.Substring(0,7))
@@ -28,6 +29,10 @@
true
+
+ octopus-$(BUILD_IDENTITY)
+
+
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;
}