Skip to content

Bump NUnit.Analyzers from 3.8.0 to 4.0.1 #51

Bump NUnit.Analyzers from 3.8.0 to 4.0.1

Bump NUnit.Analyzers from 3.8.0 to 4.0.1 #51

Workflow file for this run

name: Stravaig Clock
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'Example/**'
- '.vscode/**'
- '.gitignore'
- 'contributors.md'
- 'release-notes/**'
- '.github/PULL_REQUEST_TEMPLATE/**'
- 'src/.idea/**'
pull_request:
types: [assigned, opened, synchronize, reopened]
paths-ignore:
- 'README.md'
- 'Example/**'
- '.vscode/**'
- '.gitignore'
workflow_dispatch:
inputs:
isPublic:
description: 'Is Public Release'
required: false
default: "false"
isPreview:
description: 'Is Preview Release'
required: false
default: "true"
jobs:
build:
name: Build, Test, and Release
runs-on: ubuntu-latest
env:
STRAVAIG_SOLUTION: src/Stravaig.Clock.sln
STRAVAIG_TESTS: Stravaig.Clock.Tests
STRAVAIG_PROJECT1: Stravaig.Clock
STRAVAIG_PROJECT2: Stravaig.Clock.DependencyInjection
STRAVAIG_PROJECT3: Stravaig.Clock.Testing
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set version number
shell: pwsh
run: ./Set-Version.ps1 -IsPublic "${{ github.event.inputs.isPublic }}" -IsPreview "${{ github.event.inputs.isPreview }}"
- name: Display workflow state
run: |
echo "GITHUB_SHA: $GITHUB_SHA"
echo "Solution: $STRAVAIG_SOLUTION"
echo "Project: $STRAVAIG_PROJECT1"
echo "Project: $STRAVAIG_PROJECT2"
echo "Project: $STRAVAIG_PROJECT3"
echo "Tests: $STRAVAIG_TESTS"
echo "Package version: $STRAVAIG_PACKAGE_VERSION"
echo "Version Suffix: $STRAVAIG_PACKAGE_VERSION_SUFFIX"
echo "Full Version: $STRAVAIG_PACKAGE_FULL_VERSION"
echo "Publish To NuGet: $STRAVAIG_PUBLISH_TO_NUGET"
echo "Is Preview: $STRAVAIG_IS_PREVIEW"
echo "Is Stable: $STRAVAIG_IS_STABLE"
- uses: actions/setup-dotnet@v3
name: Setup .NET 6.0 and 7.0
with:
dotnet-version: |
6.0.x
7.0.x
- name: .NET State
run: dotnet --info
- name: Build Solution
run: dotnet build $STRAVAIG_SOLUTION --configuration Release
- name: Run Tests
run: dotnet test src/$STRAVAIG_TESTS/$STRAVAIG_TESTS.csproj --configuration Release
- name: Package Preview Release
if: ${{ env.STRAVAIG_IS_PREVIEW == 'true' }}
run: |
dotnet pack ./src/$STRAVAIG_PROJECT1/$STRAVAIG_PROJECT1.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" --version-suffix "$STRAVAIG_PACKAGE_VERSION_SUFFIX" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
dotnet pack ./src/$STRAVAIG_PROJECT2/$STRAVAIG_PROJECT2.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" --version-suffix "$STRAVAIG_PACKAGE_VERSION_SUFFIX" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
dotnet pack ./src/$STRAVAIG_PROJECT3/$STRAVAIG_PROJECT3.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" --version-suffix "$STRAVAIG_PACKAGE_VERSION_SUFFIX" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Package Stable Release
if: ${{ env.STRAVAIG_IS_STABLE == 'true' }}
run: |
dotnet pack ./src/$STRAVAIG_PROJECT1/$STRAVAIG_PROJECT1.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
dotnet pack ./src/$STRAVAIG_PROJECT2/$STRAVAIG_PROJECT2.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
dotnet pack ./src/$STRAVAIG_PROJECT3/$STRAVAIG_PROJECT3.csproj --configuration Release --output ./out --include-symbols --include-source /p:VersionPrefix="$STRAVAIG_PACKAGE_VERSION" -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Push package to NuGet
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' }}
shell: pwsh
run: |
Get-ChildItem ./out/*.nupkg | ForEach-Object {
$name = $_.FullName;
Write-Output "Pushing $name";
dotnet nuget push "$name" --api-key ${{ secrets.STRAVAIG_NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
}
- name: List Contributors
shell: pwsh
run: ./list-contributors.ps1 -HideSummaryAwards
- name: Build Release Notes
shell: pwsh
run: ./build-release-notes.ps1
- name: Archive Simulated Release Information
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'false' }}
uses: actions/upload-artifact@v3
with:
name: simulated-release-information
path: |
contributors.md
release-notes/full-release-notes.md
release-notes/release-notes-${{ env.STRAVAIG_PACKAGE_FULL_VERSION }}.md
out/**
retention-days: 7
- name: Archive Release Notes
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' }}
uses: actions/upload-artifact@v3
with:
name: release-information
path: |
contributors.md
release-notes/full-release-notes.md
release-notes/release-notes-${{ env.STRAVAIG_PACKAGE_FULL_VERSION }}.md
out/**
- name: Create Release
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' }}
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$assets = @();
$assets += "./out/*.nupkg"
$assets += "./out/*.snupkg"
$assets += "LICENSE"
$assets += "contributors.md"
$assets += "README.md"
$assets += "./release-notes/release-notes-${{ env.STRAVAIG_PACKAGE_FULL_VERSION }}.md"
./Create-Release.ps1 -NotesFile "./release-body.md" -Assets $assets
- name: Bump version
#IF Publishing & Stable release
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
shell: pwsh
run: ./Bump-Version.ps1 -BumpPatch
- name: Reset WIP release notes
#IF Publishing & Stable release
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
shell: pwsh
run: ./Reset-WipReleaseNotes.ps1
- name: Update Docs
#IF Publishing & Stable release
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
shell: pwsh
run: ./Update-Docs.ps1
- name: Commit post release updates
#IF Publishing & Stable release
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'true' && env.STRAVAIG_IS_STABLE == 'true' }}
uses: EndBug/add-and-commit@v5
with:
add: ./contributors.md ./release-notes/** ./version.txt docs/**
author_name: StravaigBot
author_email: github-bot@stravaig.scot
message: "[bot] Post v${{ env.STRAVAIG_PACKAGE_FULL_VERSION }} Release & Bump Version updates."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}