Merge pull request #34 from dotnetprojects/copilot/fix-switched-add-m… #71
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: .NET | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Fetch history | |
| run: git fetch --prune --unshallow | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: GitVersion | |
| id: gitversion # step id used as reference for output values | |
| uses: roryprimrose/rungitversion@v1 | |
| - name: Update project version | |
| uses: roryprimrose/set-vs-sdk-project-version@v1 | |
| with: | |
| version: ${{ steps.gitversion.outputs.NuGetVersionV2 }} | |
| assemblyVersion: ${{ steps.gitversion.outputs.AssemblySemVer }} | |
| fileVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }} | |
| informationalVersion: ${{ steps.gitversion.outputs.InformationalVersion }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: TiaCodegen-ts/package-lock.json | |
| - name: Install TypeScript dependencies | |
| run: npm ci | |
| working-directory: TiaCodegen-ts | |
| - name: Build TypeScript | |
| run: npm run build | |
| working-directory: TiaCodegen-ts | |
| - name: Test TypeScript | |
| run: npm test | |
| working-directory: TiaCodegen-ts | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal | |
| - name: Package | |
| run: dotnet pack -c Debug -o . TiaCodegen/DotNetProjects.TiaCodegen.csproj | |
| - name: Publish | |
| run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |