From 1224efd07f974d308814b2f63b24bb8275f17584 Mon Sep 17 00:00:00 2001 From: Matthew DeVenny Date: Tue, 30 Jun 2026 10:59:20 -0700 Subject: [PATCH] Update workflows Signed-off-by: Matthew DeVenny --- .github/workflows/build.yml | 21 +++++++++++++++++++-- .github/workflows/publish.yml | 17 ++++++++++++----- README.md | 4 ++-- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6238cd..ae714fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,11 @@ on: - "src/**" - "test/**" - "util/**" + - "dev/**" + - "Directory.Build.props" + - "Directory.Build.targets" + - "*.slnx" + - ".editorconfig" pull_request: branches: - "main" @@ -17,10 +22,20 @@ on: - "src/**" - "test/**" - "util/**" + - "dev/**" + - "Directory.Build.props" + - "Directory.Build.targets" + - "*.slnx" + - ".editorconfig" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: test: runs-on: ubuntu-latest + timeout-minutes: 20 permissions: contents: read actions: read @@ -33,10 +48,12 @@ jobs: - name: CargoWall uses: code-cargo/cargowall-action@c0bd989036354f795a5150d478fce5bd510586af # v1.3.2-rc.3 - name: Checkout - uses: actions/checkout@v7 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false - name: Setup dotnet - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 with: cache: true cache-dependency-path: '**/packages.linux-x64.lock.json' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b3070a3..58587e4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,6 +15,7 @@ jobs: name: NuGet environment: nuget runs-on: ubuntu-latest + timeout-minutes: 15 permissions: contents: read @@ -23,10 +24,12 @@ jobs: steps: - name: CargoWall uses: code-cargo/cargowall-action@c0bd989036354f795a5150d478fce5bd510586af # v1.3.2-rc.3 - - uses: actions/checkout@v7 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false - name: Setup dotnet - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 with: cache: true cache-dependency-path: '**/packages.linux-x64.lock.json' @@ -49,7 +52,11 @@ jobs: - name: Pack run: dotnet pack -c Release -p:version=${GITHUB_REF#refs/*/v} -o ./publish + - name: Log in to NuGet.org with Trusted Publishing (OIDC) + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 + id: nuget-login + with: + user: CodeCargo + - name: Publish to NuGet.org - run: dotnet nuget push ./publish/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate - env: - NUGET_API_KEY: ${{secrets.NUGET_API_KEY}} + run: dotnet nuget push ./publish/*.nupkg --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/README.md b/README.md index 8293ee0..090536c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Overview -A .NET 8+ library for using NATS with `HybridCache` or as an `IDistributedCache` directly. +A .NET 8+ library (tested on .NET 8 and .NET 10) for using NATS with `HybridCache` or as an `IDistributedCache` directly. ## Requirements @@ -123,5 +123,5 @@ await host.RunAsync(); ## Additional Resources -* [ASP.NET Core Hybrid Cache Documentation](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid?view=aspnetcore-9.0) +* [ASP.NET Core Hybrid Cache Documentation](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/hybrid?view=aspnetcore-10.0) * [NATS .NET Client Documentation](https://nats-io.github.io/nats.net/api/NATS.Client.Core.NatsOpts.html)