Skip to content

Update nuget.yml

Update nuget.yml #2

Workflow file for this run

name: .NET
on:
push: {}
pull_request: {}
workflow_dispatch:
inputs:
publish-packages:
description: Publish packages?
type: boolean
required: true
jobs:
modularpipeline:
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Clear NuGet Cache
run: dotnet nuget locals all --clear
- name: Restore Packages
run: |
for i in {1..3}; do
dotnet restore && break || sleep 10;
done
- name: Build
run: dotnet build -c Release
- name: Run Pipeline
run: dotnet run -c Release
working-directory: "TUnit.Pipeline"
env:
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
DOTNET_ENVIRONMENT: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }}
NuGet__ApiKey: ${{ secrets.NUGET__APIKEY }}
NuGet__ShouldPublish: ${{ (github.event.inputs.publish-packages || false) && matrix.os == 'ubuntu-latest' }}
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: TestingPlatformDiagnosticLogs${{matrix.os}}
path: '**/log_*.diag'
- name: NuGet Packages Artifacts
uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: NuGetPackages${{matrix.os}}
path: '**/*.*nupkg'