Skip to content

Limit CI builds to main branch and PRs #1033

Limit CI builds to main branch and PRs

Limit CI builds to main branch and PRs #1033

name: NUnitConsoleAndEngine.CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
release:
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
jobs:
ContinuousIntegration:
name: Continuous Integration
runs-on: windows-latest
env:
MYGET_API_KEY: ${{ secrets.PUBLISH_MYGET_ORG }}
NUGET_API_KEY: ${{ secrets.PUBLISH_NUGET_ORG }}
CHOCO_API_KEY: ${{ secrets.PUBLISH_CHOCOLATEY_ORG }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_CP }}
steps:
- name: ⤵️ Checkout Source
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: 🛠️ Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
8.0.x
9.0.x
- name: 🔧 Install dotnet tools
run: dotnet tool restore
- name: 🔨 Build, Test and Package
run: dotnet cake --target=BuildTestAndPackage --configuration=Release #--verbosity=diagnostic
# Upload packages before publishing in case of later failures
- name: 💾 Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: NUnitConsole Packages
path: |
packages/*.nupkg
packages/results/
- name: Publish only if current commit is labeled
run: |
dotnet minver
dotnet cake --target=Publish --configuration=Release --noBuild --nopush