Bump NUnit from 3.14.0 to 4.0.1 #377
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: Stravaig Short Code | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'README.md' | |
- 'Example/**' | |
- '.vscode/**' | |
- '.gitignore' | |
- 'contributors.md' | |
- '.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.ShortCode.sln | |
STRAVAIG_TESTS: Stravaig.ShortCode.Tests | |
STRAVAIG_PROJECT: Stravaig.ShortCode | |
steps: | |
- name: List environment vars | |
run: env | |
- 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_PROJECT" | |
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, 7.0 & 8.0 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Build Solution | |
run: dotnet build $STRAVAIG_SOLUTION --configuration Release | |
- name: Run Tests | |
run: dotnet test src/$STRAVAIG_TESTS/$STRAVAIG_TESTS.csproj --configuration Release --filter TestCategory!=LongStressTest | |
- name: Package Preview Release | |
if: ${{ env.STRAVAIG_IS_PREVIEW == 'true' }} | |
run: dotnet pack $STRAVAIG_SOLUTION --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 $STRAVAIG_SOLUTION --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 -HideAKAs | |
- name: Build Release Notes | |
shell: pwsh | |
run: ./build-release-notes.ps1 | |
- name: Archive Simulated Release Notes | |
if: ${{ env.STRAVAIG_PUBLISH_TO_NUGET == 'false' }} | |
uses: actions/upload-artifact@v2 | |
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@v2 | |
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: 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 | |
author_name: StravaigBot | |
author_email: github@stravaig.scot | |
message: "[bot] Post v${{ env.STRAVAIG_PACKAGE_FULL_VERSION }} Release & Bump Version updates." | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |