Skip to content

Merge pull request #1 from JarrodJ83/latest-xunit #19

Merge pull request #1 from JarrodJ83/latest-xunit

Merge pull request #1 from JarrodJ83/latest-xunit #19

Workflow file for this run

name: .NET
on:
push:
pull_request:
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build Xunit.Runner.Http.sln -c Release
publish:
runs-on: self-hosted
needs: [Build]
steps:
- name: Publish Nuget Packages
run: |
$branchParts = "${{ github.ref }}".Split('/');
$branch = $branchParts[$branchParts.Length - 1]
$prerelease = ""
if($branch -ne "main") {
$prerelease = $branch.Replace("/", "-") + ".${{ github.run_number }}"
}
Write-Host "Branch: $branch"
Write-Host "Pre-Release: $prerelease"
$output = "packages"
if($prerelease -ne "") {
Write-Host "Branch: Creating Prerelease $prerelease packages"
dotnet pack Xunit.Runner.Http/Xunit.Runner.Http.csproj -c Release --no-build --no-restore --version-suffix $prerelease -o $output
} else {
Write-Host "Branch: Creating Release packages"
dotnet pack Xunit.Runner.Http/Xunit.Runner.Http.csproj -c Release --no-build --no-restore -o $output
}
dotnet nuget push "**/$output/**" --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate