Skip to content

Commit 66b8a33

Browse files
committed
fix: workflows
1 parent 0a9e3b1 commit 66b8a33

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/dotnet-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: .NET Tests
2-
2+
defaults:
3+
working-directory: ./Parameterize.Net
34
on:
45
push:
56
branches: [ main ]

.github/workflows/nuget-pub.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish NuGet Package
2+
defaults:
3+
working-directory: ./my-project-root
4+
on:
5+
push:
6+
tags:
7+
- 'v*' # triggers on tags like v1.0.0
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v3
19+
with:
20+
dotnet-version: 8.0.x # adjust to your target .NET version
21+
22+
- name: Restore dependencies
23+
run: dotnet restore
24+
25+
- name: Build
26+
run: dotnet build --configuration Release --no-restore
27+
28+
- name: Pack
29+
run: dotnet pack ./Parameterize.Net/Parameterize.Net.csproj --configuration Release --no-build -o ./nupkg
30+
31+
- name: Push to NuGet
32+
uses: nuget/setup-nuget@v3
33+
34+
- name: Publish package
35+
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)