Merge pull request #9 from gui-cs/v2_update4519 #46
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and package | |
| on: push | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| job: [package-template, test-template] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.x' | |
| - name: Build and Package Template | |
| if: matrix.job == 'package-template' | |
| run: | | |
| cd templates/basic | |
| dotnet build | |
| dotnet pack --output ../../nupkgs | |
| - name: Publish to NuGet | |
| if: matrix.job == 'package-template' && contains(github.ref, 'refs/tags/v') | |
| run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json | |
| - name: Test Template Install and Build | |
| if: matrix.job == 'test-template' | |
| run: | | |
| # Install the template locally | |
| dotnet new --install templates/basic | |
| # Create a new project from the template | |
| mkdir testapp | |
| cd testapp | |
| dotnet new tui -n myproj | |
| cd myproj | |
| # Build the generated project | |
| dotnet build |