Skip to content

Update build status badge #702

Update build status badge

Update build status badge #702

Workflow file for this run

name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
defaults:
run:
working-directory: src
env:
Configuration: Release
jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
include:
- os: windows-latest
osLabel: Windows
runtimeId: win-x64
- os: ubuntu-latest
osLabel: Linux
runtimeId: linux-x64
name: Build ${{ matrix.osLabel }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: Restore dependencies
run: dotnet restore
# Always run a debug build to validate XML comments
- name: Build
run: dotnet build --configuration Debug --no-restore
- name: Build (Release)
if: env.Configuration == 'Release'
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-build --configuration ${{ env.Configuration }} --verbosity normal
- name: Get version
id: get-version
uses: actions/github-script@v6
with:
script: return /\<Version\>(.+)\<\/Version\>/.exec(require('fs').readFileSync('src/Directory.Build.props'))[1]
result-encoding: string
- name: Pack Analyzer.Core
run: nuget pack Analyzer.Core.NuGet/Analyzer.Core.nuspec -Version ${{ steps.get-version.outputs.result }} -Properties configuration=${{ env.Configuration }}
- name: Pack Analyzer.TemplateProcessing
run: nuget pack Analyzer.TemplateProcessing.NuGet/Analyzer.TemplateProcessing.nuspec -Version ${{ steps.get-version.outputs.result }} -Properties configuration=${{ env.Configuration }}
- name: (dotnet) Publish CLI
run: dotnet publish Analyzer.Cli/Analyzer.Cli.csproj --configuration ${{ env.Configuration }} --runtime ${{ matrix.runtimeId }} --self-contained /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:DebugType=None /p:DebugSymbols=false
- name: Pack Analyzer.CLI
run: nuget pack Analyzer.Cli.NuGet/Analyzer.Cli.nuspec -Version ${{ steps.get-version.outputs.result }} -Properties "configuration=${{ env.Configuration }};runtimeId=${{ matrix.runtimeId }}"