Add version guardrails: don't delete Node changesets, guide on no .NE… #1
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 Test | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: ["main", "jcamp"] | |
| push: | |
| branches: ["main", "jcamp"] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore --packages ./packages | |
| - name: Build | |
| run: dotnet build -c Release --no-restore | |
| - name: Test | |
| run: dotnet test -c Release --no-restore --no-build --verbosity normal | |
| - name: Pack | |
| run: dotnet pack -c Release --no-restore --no-build | |
| - name: Upload NuGet package as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-package | |
| path: ./nupkg/*.nupkg | |
| - name: Format | |
| run: dotnet format --no-restore --verify-no-changes | |
| parity: | |
| # Runs the [Category("Parity")] tests against the real Node @changesets CLI so format or behaviour drift | |
| # between net-changesets and Node is caught. Kept as its own job so the core build stays Node-free; the | |
| # checked-in golden changelogs already enforce changelog-format parity in build-and-test without Node. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 10.0.x | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install the Node @changesets CLI | |
| run: npm ci | |
| working-directory: demo/node-sample | |
| - name: Restore dependencies | |
| run: dotnet restore --packages ./packages | |
| - name: Build | |
| run: dotnet build -c Release --no-restore | |
| - name: Parity tests | |
| run: dotnet test -c Release --no-restore --no-build --filter "TestCategory=Parity" --verbosity normal |