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
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ jobs:
name: ${{ matrix.name }}
path: nuget.package/runtimes/${{ matrix.name }}
package:
name: Create package
needs: build
runs-on: ubuntu-24.04
env:
DOTNET_NOLOGO: true
steps:
name: Create package
needs: build
runs-on: ubuntu-24.04
env:
DOTNET_NOLOGO: true
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
Expand All @@ -92,3 +92,10 @@ jobs:
with:
name: NuGet package
path: ./nuget.package/*.nupkg
- name: Push package to feed 🐙
id: push-feed
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id: push-feed step id isn't referenced anywhere in this workflow. If you don't consume outputs from this step later, drop the id to reduce noise.

Suggested change
id: push-feed

Copilot uses AI. Check for mistakes.
shell: bash
env:
FEED_API_KEY: ${{ secrets.FEED_API_KEY }}
FEED_SOURCE: ${{ secrets.FEED_SOURCE }}
run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE"
Comment on lines +95 to +101
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The push-to-feed step currently runs for branch pushes and pull_request runs as well, which can (a) unintentionally publish packages from non-release builds and (b) fail PR builds because secrets are not provided to workflows from forks. Gate this step (or the whole package job) so it only runs on tag pushes (e.g., github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')), and optionally restrict to the canonical repo/owner.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet nuget push without --skip-duplicate makes the workflow non-idempotent: rerunning a successful tag build (or rebuilding an existing tag) will typically fail with a conflict when the version already exists in the feed. Consider adding --skip-duplicate (and/or pushing only the intended package type) so release reruns don't fail unnecessarily.

Suggested change
run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE"
run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" --skip-duplicate

Copilot uses AI. Check for mistakes.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ dotnet tool install --global minver-cli
Once that is installed, running the `minver` command will output a version:

```
MinVer: Using { Commit: 2453a6d, Tag: '2.0.312', Version: 2.0.312, Height: 3 }.
MinVer: Using { Commit: 2453a6d, Tag: '2.0.323', Version: 2.0.323, Height: 3 }.
MinVer: Calculated version 2.0.313-alpha.0.3.
2.0.313-alpha.0.3
Comment on lines 90 to 91
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MinVer output example is internally inconsistent: it shows Tag: '2.0.323' but then Calculated version 2.0.313-alpha.0.3 / 2.0.313-alpha.0.3 (lower than the tag). Update the example so the calculated version matches the shown tag (or adjust the tag/version pair together).

Suggested change
MinVer: Calculated version 2.0.313-alpha.0.3.
2.0.313-alpha.0.3
MinVer: Calculated version 2.0.324-alpha.0.3.
2.0.324-alpha.0.3

Copilot uses AI. Check for mistakes.
```
Expand All @@ -100,6 +100,25 @@ nuget.exe Pack nuget.package/NativeBinaries.nuspec -Version <version> -NoPackage
Where `<version>` is the version from the MinVer tool or manually chosen version.


## Releasing this Octopus fork

Releases are triggered by pushing a git tag. The tag format is:

```
<upstream-version>-octopus.<n>
```

Where `<upstream-version>` is the version from the upstream libgit2sharp.nativebinaries repo (e.g., `2.0.323`) and `<n>` is an incrementing number starting at 1. The incrementing number resets to 1 when the upstream version changes.

For example, for upstream version `2.0.323`:

```
git tag 2.0.323-octopus.1
git push origin 2.0.323-octopus.1
```

This triggers CI, which builds all native binaries, packs the NuGet package with the tag as its version, and pushes it to the configured feed.

## Notes on Visual Studio

Visual Studio 2019 is required to build the Windows native binaries, however you
Expand Down
Loading