From 2eca299810db5686533bc3102d24f9626bc34ded Mon Sep 17 00:00:00 2001 From: gdlol Date: Sun, 9 Nov 2025 17:40:59 +0000 Subject: [PATCH 1/4] Update Nuget publish. --- .github/workflows/publish.yml | 1 + Automation/Pack.cs | 8 +++++++- ReadMe.md | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2068cbd..46d1105 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,6 +21,7 @@ jobs: - name: Publish uses: devcontainers/ci@v0.3 env: + NUGET_AUTHORS: ${{ github.repository_owner }} NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} with: imageName: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer diff --git a/Automation/Pack.cs b/Automation/Pack.cs index 15bcf74..66186e0 100644 --- a/Automation/Pack.cs +++ b/Automation/Pack.cs @@ -1,3 +1,4 @@ +using Cake.Common.Diagnostics; using Cake.Common.IO; using Cake.Common.Tools.DotNet; using Cake.Frosting; @@ -12,7 +13,12 @@ public override void Run(Context context) context.CleanDirectory(Context.PackagesDirectory); using var repository = new Git.Repository(Context.ProjectRoot); - string authors = repository.Config.Get("user.name").Value; + string authors = + Environment.GetEnvironmentVariable("NUGET_AUTHORS") + ?? repository.Config.Get("user.name")?.Value ?? throw new InvalidOperationException( + "Could not retrieve authors." + ); + context.Information($"Authors: {authors}"); context.DotNetPack( Path.Combine(Context.ProjectRoot, "Divert.Windows"), diff --git a/ReadMe.md b/ReadMe.md index 8dffa1b..3cd32fb 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -5,10 +5,12 @@ [Codecov Badge]: https://img.shields.io/codecov/c/github/gdlol/Divert.Windows [Codecov URL]: https://codecov.io/gh/gdlol/Divert.Windows [License Badge]: https://img.shields.io/github/license/gdlol/Divert.Windows +[NuGet Version]: https://img.shields.io/nuget/v/Divert.Windows [![CI Badge][CI Badge]][CI URL] [![Codecov Badge][Codecov Badge]][Codecov URL] [![License Badge][License Badge]](LICENSE) +[![NuGet Version][NuGet Version]](https://www.nuget.org/packages/Divert.Windows) High quality .NET APIs for WinDivert. From 704d6a968d709591b381f6590f2e8f8f8ecd7093 Mon Sep 17 00:00:00 2001 From: gdlol Date: Sun, 9 Nov 2025 17:59:47 +0000 Subject: [PATCH 2/4] Add CI package artifact. --- .github/workflows/publish.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 46d1105..9d5f6d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,6 +18,20 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Pack + uses: devcontainers/ci@v0.3 + with: + imageName: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer + cacheFrom: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer + push: never + runCmd: pnpm run pack + + - name: Upload NuGet Package + uses: actions/upload-artifact@v4 + with: + name: nuget-package + path: .local/packages + - name: Publish uses: devcontainers/ci@v0.3 env: @@ -28,3 +42,6 @@ jobs: cacheFrom: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer push: never runCmd: pnpm run publish + env: | + NUGET_AUTHORS + NUGET_API_KEY From 72a29dc8d45d19d5809e64e5353576640965c200 Mon Sep 17 00:00:00 2001 From: gdlol Date: Sun, 9 Nov 2025 18:07:34 +0000 Subject: [PATCH 3/4] Fix CI --- .github/workflows/publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9d5f6d7..ead7485 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,11 +20,15 @@ jobs: - name: Pack uses: devcontainers/ci@v0.3 + env: + NUGET_AUTHORS: ${{ github.repository_owner }} with: imageName: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer cacheFrom: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer push: never runCmd: pnpm run pack + env: | + NUGET_AUTHORS - name: Upload NuGet Package uses: actions/upload-artifact@v4 From d4dd5ac6595b7bbcb5a321b90222629235db8c25 Mon Sep 17 00:00:00 2001 From: gdlol Date: Sun, 9 Nov 2025 18:18:29 +0000 Subject: [PATCH 4/4] update fetch-depth --- .github/workflows/publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ead7485..2ac4bf0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,6 +17,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Pack uses: devcontainers/ci@v0.3 @@ -34,7 +36,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: nuget-package - path: .local/packages + path: .local/packages/* - name: Publish uses: devcontainers/ci@v0.3