Skip to content

Bump NUnit.Analyzers from 4.2.0 to 4.3.0 #788

Bump NUnit.Analyzers from 4.2.0 to 4.3.0

Bump NUnit.Analyzers from 4.2.0 to 4.3.0 #788

Workflow file for this run

name: ci
on:
workflow_dispatch:
push:
pull_request:
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test --configuration Release --logger trx --results-directory reports --collect:"XPlat Code Coverage"
# - name: Report
# uses: dorny/test-reporter@v1
# if: success() || failure()
# with:
# name: report
# path: reports/*.trx
# reporter: dotnet-trx
release:
name: release
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
nuget_key: ${{ secrets.NUGET_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
- name: Setup GitVersion
run: dotnet tool install --global GitVersion.Tool
- name: Fetch Git tags
run: git fetch --tags --unshallow
- name: Fetch main branch
if: github.ref != 'refs/heads/main'
run: git branch --create-reflog main origin/main
- name: Query last tag
id: LAST
run: echo ::set-output name=tag::$(git describe --tags --abbrev=0)
- name: Update version
run: dotnet-gitversion /updateprojectfiles /updateassemblyinfo /output buildserver
- name: Build
run: dotnet build --configuration Release
- name: Pack
if: ${{env.nuget_key != ''}}
run: dotnet pack --configuration Release --output nupkgs --include-symbols --include-source
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{ env.GitVersion_LegacySemVer }}
name: v${{ env.GitVersion_LegacySemVer }}
draft: false
prerelease: ${{ env.GitVersion_PreReleaseLabel == 'alpha' || env.GitVersion_PreReleaseLabel == 'beta' }}
- name: Publish project to NuGet
if: ${{env.nuget_key != ''}}
run: dotnet nuget push '**/*.nupkg' -k ${{ env.nuget_key }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Push version bump
if: ${{env.GitVersion_PreReleaseLabel == '' || env.GitVersion_PreReleaseLabel == 'alpha' || env.GitVersion_PreReleaseLabel == 'beta'}}
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
message: "Bumped version to ${{ env.GitVersion_LegacySemVer }}"
approve:
name: approve
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Approve pull request
uses: juliangruber/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.number }}