Skip to content

Commit 0d28dce

Browse files
committed
Add GitHub Actions workflow for NuGet package build
Introduces a workflow to build, pack, and upload NuGet packages on release creation or push to master. The workflow sets up .NET 10, restores dependencies, builds the project, creates the package, and uploads it as an artifact.
1 parent f40c10f commit 0d28dce

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: build
2+
3+
on:
4+
release:
5+
types: [created]
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: 10.0.x
21+
22+
- name: Install dependencies
23+
run: dotnet restore src\System.IO.Hashing.XxHash.csproj
24+
25+
- name: Build
26+
run: dotnet build src\System.IO.Hashing.XxHash.csproj --configuration Release --no-restore
27+
28+
- name: Pack
29+
run: dotnet pack src\System.IO.Hashing.XxHash.csproj -c Release --no-build -o out
30+
31+
- name: Push NuGet package
32+
# run: dotnet nuget push "out\*.nupkg" -k ${{secrets.NUGET_AUTH_TOKEN}} --source https://api.nuget.org/v3/index.json
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: nuget-packages
36+
path: out/*.nupkg

0 commit comments

Comments
 (0)