From 65c4f56f43bba7766ff10712d7c0f6d032c87227 Mon Sep 17 00:00:00 2001 From: bugRanger Date: Wed, 1 Jul 2026 12:58:03 +0700 Subject: [PATCH] Add pack nuget on CI --- .github/workflows/nuget-pack.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/nuget-pack.yml diff --git a/.github/workflows/nuget-pack.yml b/.github/workflows/nuget-pack.yml new file mode 100644 index 0000000..56c2cc1 --- /dev/null +++ b/.github/workflows/nuget-pack.yml @@ -0,0 +1,33 @@ +name: Build and Pack NuGet + +on: + release: + types: [published] + +jobs: + build-and-pack: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build and Pack + run: | + VERSION=${GITHUB_REF_NAME#v} + dotnet pack -c Release --no-restore -o ./artifacts /p:PackageVersion=$VERSION + + - name: Upload NuGet to GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: artifacts/*.nupkg