Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 #151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET CI | |
on: | |
push: | |
branches: [ "main" ] | |
tags: [ "**" ] | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Format | |
run: dotnet format --verify-no-changes | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build | |
run: dotnet build | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
pack: | |
runs-on: ubuntu-latest | |
needs: | |
- format | |
- build | |
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Determine version | |
run: echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_ENV | |
- name: Pack | |
run: dotnet pack --output ./artifacts --configuration Release -p:Version=$VERSION | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: artifacts | |
path: ./artifacts | |
publish: | |
runs-on: ubuntu-latest | |
needs: pack | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifacts | |
path: ./artifacts | |
- name: Publish packages | |
run: dotnet nuget push ./artifacts/**/*.nupkg --source nuget.org --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate |