File tree Expand file tree Collapse file tree 1 file changed +36
-8
lines changed
Expand file tree Collapse file tree 1 file changed +36
-8
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,43 @@ name: Build and package
33on : push
44
55jobs :
6- package :
6+ build :
77 runs-on : ubuntu-latest
8+
9+ strategy :
10+ matrix :
11+ job : [package-template, test-template]
12+
813 steps :
914 - uses : actions/checkout@v3
10- - name : Build
11- run : cd templates/basic && dotnet build
12- - name : Pack
13- run : dotnet pack
14- - name : Publish to Nuget
15- if : contains(github.ref, 'refs/tags/v')
16- run : dotnet nuget push ./bin/Release/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
1715
16+ - name : Set up .NET
17+ uses : actions/setup-dotnet@v3
18+ with :
19+ dotnet-version : ' 8.x'
20+
21+ - name : Build and Package Template
22+ if : matrix.job == 'package-template'
23+ run : |
24+ cd templates/basic
25+ dotnet build
26+ dotnet pack --output ../../nupkgs
27+
28+ - name : Publish to NuGet
29+ if : matrix.job == 'package-template' && contains(github.ref, 'refs/tags/v')
30+ run : dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
31+
32+ - name : Test Template Install and Build
33+ if : matrix.job == 'test-template'
34+ run : |
35+ # Install the template locally
36+ dotnet new --install templates/basic
37+
38+ # Create a new project from the template
39+ mkdir testapp
40+ cd testapp
41+ dotnet new tui -n myproj
42+ cd myproj
43+
44+ # Build the generated project
45+ dotnet build
You can’t perform that action at this time.
0 commit comments