Skip to content

Bump xunit from 2.5.0 to 2.5.1 (#61) #51

Bump xunit from 2.5.0 to 2.5.1 (#61)

Bump xunit from 2.5.0 to 2.5.1 (#61) #51

Workflow file for this run

name: 'Treasure.Utils-CI'
on:
push:
branches:
- main
paths-ignore:
- '.config/**'
- '.github/dependabot.yml'
- '.vscode/**'
- 'docs/**'
- 'README.md'
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
build:
name: 'Build Treasure.Utils'
runs-on: ubuntu-latest
outputs:
package_version: ${{steps.version.outputs.package_version}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
7.x
- name: Patch global.json if necessary
shell: pwsh
run: ./scripts/PatchGlobalJson.ps1
- name: Set version
id: version
shell: pwsh
run: |
dotnet tool restore
$packageVersion = dotnet nbgv get-version --variable NuGetPackageVersion
"package_version=$packageVersion" >> $env:GITHUB_OUTPUT
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: codecov
directory: __test-results
fail_ci_if_error: true
verbose: true
- name: Upload output artifact
uses: actions/upload-artifact@v3
with:
name: __output
path: __output
- name: Upload package artifact
uses: actions/upload-artifact@v3
with:
name: __packages
path: __packages
release_nuget:
name: 'Release Treasure.Utils to NuGet.org'
runs-on: ubuntu-latest
needs: build
environment:
name: NuGet.org
url: https://www.nuget.org
env:
PACKAGE_VERSION: ${{ needs.build.outputs.package_version }}
if: ${{ contains(github.event.head_commit.message, 'do release') }}
steps:
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
with:
nuget-version: latest
- name: Download __packages
uses: actions/download-artifact@v3
with:
name: __packages
path: __packages
- name: Push ${{ env.PACKAGE_VERSION }} to NuGet.org
run: nuget push __packages/NuGet/Release/Treasure.Utils.*.nupkg -ApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json