Update nuget.yml #2
This file contains 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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
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: 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' |