Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,37 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Pack
uses: devcontainers/[email protected]
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
with:
name: nuget-package
path: .local/packages/*

- name: Publish
uses: devcontainers/[email protected]
env:
NUGET_AUTHORS: ${{ github.repository_owner }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
with:
imageName: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer
cacheFrom: ghcr.io/${{ env.GITHUB_REPOSITORY }}/devcontainer
push: never
runCmd: pnpm run publish
env: |
NUGET_AUTHORS
NUGET_API_KEY
8 changes: 7 additions & 1 deletion Automation/Pack.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Cake.Common.Diagnostics;
using Cake.Common.IO;
using Cake.Common.Tools.DotNet;
using Cake.Frosting;
Expand All @@ -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<string>("user.name").Value;
string authors =
Environment.GetEnvironmentVariable("NUGET_AUTHORS")
?? repository.Config.Get<string>("user.name")?.Value ?? throw new InvalidOperationException(
"Could not retrieve authors."
);
context.Information($"Authors: {authors}");

context.DotNetPack(
Path.Combine(Context.ProjectRoot, "Divert.Windows"),
Expand Down
2 changes: 2 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading