File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish NuGet Package
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' v*' # Triggers on push of a tag that starts with "v" (e.g., v1.0.0)
7
+
8
+ jobs :
9
+ build-test-and-publish :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout repository
14
+ uses : actions/checkout@v2
15
+
16
+ - name : Setup .NET SDK
17
+ uses : actions/setup-dotnet@v2
18
+ with :
19
+ dotnet-version : ' 7.0.x' # Specify the required .NET SDK version (e.g., 6.0.x or another version)
20
+
21
+ - name : Restore dependencies
22
+ run : dotnet restore
23
+
24
+ - name : Build project
25
+ run : dotnet build --configuration Release --no-restore
26
+
27
+ - name : Run tests
28
+ run : dotnet test SolveCaptcha.Tests/SolveCaptcha.Tests.csproj --configuration Release --no-build
29
+
30
+ - name : Pack project
31
+ run : dotnet pack --configuration Release --no-build --output nupkg
32
+
33
+ - name : Publish package to NuGet
34
+ env :
35
+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
36
+ run : dotnet nuget push nupkg/solvecaptcha-csharp.*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
You can’t perform that action at this time.
0 commit comments