Skip to content

Commit 8dcea9b

Browse files
committed
Publish script
1 parent 6f3a247 commit 8dcea9b

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

.github/workflows/publishNuGet.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,27 @@ jobs:
1717
# Setup .NET
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v3
20-
with:
21-
dotnet-version: '8.0.x'
20+
with:
21+
dotnet-version: '8.0.x'
22+
23+
# Restore dependencies
24+
- name: Restore dependencies
25+
run: dotnet restore
26+
27+
# Build the project
28+
- name: Build
29+
run: dotnet build --configuration Release --no-restore
30+
31+
# Run tests
32+
- name: Run tests
33+
run: dotnet test --configuration Release --no-build --verbosity normal
34+
35+
# Pack the project into a NuGet package
36+
- name: Pack
37+
run: dotnet pack --configuration Release --no-build --output ./nupkg
38+
39+
# Publish the NuGet package
40+
- name: Publish to NuGet
41+
env:
42+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
43+
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json

ApiEase.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiEase.Core", "ApiEase.Core\ApiEase.Core.csproj", "{9C55D118-B405-471F-B701-16DC0036DEFF}"
44
EndProject
5+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{77D7D6F2-05CC-457D-9C39-9172F032084A}"
6+
ProjectSection(SolutionItems) = preProject
7+
.github\workflows\publishNuGet.yml = .github\workflows\publishNuGet.yml
8+
EndProjectSection
9+
EndProject
510
Global
611
GlobalSection(SolutionConfigurationPlatforms) = preSolution
712
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)