Skip to content

chore(deps): update codecov/codecov-action action to v3 - autoclosed #61

chore(deps): update codecov/codecov-action action to v3 - autoclosed

chore(deps): update codecov/codecov-action action to v3 - autoclosed #61

Workflow file for this run

name: .NET
on:
push:
tags:
- v*
branches:
- main
paths:
- src/**
- tests/**
- build/**
- .github/workflows/dotnet.yml
- global.json
pull_request:
branches:
- main
paths:
- src/**
- tests/**
- build/**
- .github/workflows/dotnet.yml
- global.json
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'XmlRpc.SourceGenerator.sln'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- 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 NuGet
uses: NuGet/setup-nuget@v1.0.5
- name: Restore dependencies
run: nuget restore $SOLUTION
- name: Build
run: dotnet build $env:SOLUTION -c $env:BUILD_CONFIG -p:Version=$env:BUILD_VERSION --no-restore
- name: Test
run: dotnet test -c $env:BUILD_CONFIG /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --no-restore --no-build -c Release --verbosity normal
- name: Codecov
uses: codecov/codecov-action@v3
- name: Verify commit exists in origin/main
if: startsWith(github.ref, 'refs/tags/v')
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_TOKEN}}