43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: .NET
|
|
|
|
on:
|
|
create:
|
|
branches:
|
|
- release/**
|
|
push:
|
|
branches: [ "master" ]
|
|
pull_request:
|
|
branches: [ "master" ]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup NuGet
|
|
uses: NuGet/setup-nuget@v1.0.5
|
|
|
|
- name: Get Build Version
|
|
run: |
|
|
Import-Module .\build\GetBuildVersion.psm1
|
|
Write-Host $Env:GITHUB_REF
|
|
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
|
|
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
|
shell: pwsh
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: 8.0.x
|
|
- name: Restore dependencies
|
|
run: dotnet restore src/CodeCoverageExtractor.csproj
|
|
- name: Build
|
|
run: dotnet build --no-restore -p:Version=$BUILD_VERSION src/CodeCoverageExtractor.csproj
|
|
|
|
- name: Publish
|
|
if: startsWith(github.ref, 'refs/heads/release')
|
|
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_KEY}}
|