Bump TUnit from 1.19.74 to 1.21.30 #150
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 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore SLNX-validator.slnx | |
| - name: Build | |
| run: dotnet build SLNX-validator.slnx --no-restore -c Release | |
| - name: Test | |
| run: dotnet test --solution SLNX-validator.slnx --no-build -c Release --verbosity normal | |
| - name: Determine version suffix | |
| id: version | |
| run: | | |
| if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then | |
| echo "suffix=" >> $GITHUB_OUTPUT | |
| else | |
| CLEAN=$(echo "$GITHUB_REF_NAME" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/-\+/-/g' | sed 's/^-//;s/-$//') | |
| echo "suffix=$CLEAN" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Pack | |
| run: | | |
| VERSION_SUFFIX="${{ steps.version.outputs.suffix }}" | |
| if [ -n "$VERSION_SUFFIX" ]; then | |
| dotnet pack SLNX-validator.slnx --no-build -c Release --output artifacts --version-suffix "$VERSION_SUFFIX" | |
| else | |
| dotnet pack SLNX-validator.slnx --no-build -c Release --output artifacts | |
| fi | |
| - name: Upload nuget package | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| compression-level: 0 | |
| name: nupkg | |
| path: artifacts/*.nupkg | |
| - name: NuGet login | |
| if: github.ref == 'refs/heads/main' | |
| uses: NuGet/login@v1 | |
| id: login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push to NuGet.org | |
| if: github.ref == 'refs/heads/main' | |
| run: dotnet nuget push artifacts/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate |