Skip to content

Bump Microsoft.VSSDK.BuildTools from 17.6.2164 to 17.7.2196 #179

Bump Microsoft.VSSDK.BuildTools from 17.6.2164 to 17.7.2196

Bump Microsoft.VSSDK.BuildTools from 17.6.2164 to 17.7.2196 #179

Workflow file for this run

name: Stravaig Extensions Core
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'Example/**'
- '.vscode/**'
- '.gitignore'
- 'contributors.md'
- 'release-notes/**'
- '.github/PULL_REQUEST_TEMPLATE/**'
- 'src/.idea/**'
- 'docs/**' # Don't rebuild if only change is to the docs.
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.Extensions.sln
STRAVAIG_PROJECT: Stravaig.Extensions.Core
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_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 3.1 to 7.0
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Build Solution
run: dotnet build $STRAVAIG_SOLUTION --configuration Release
- name: Run SEC Tests
run: dotnet test src/Stravaig.Extensions.Core.Tests/Stravaig.Extensions.Core.Tests.csproj --configuration Release
- name: Run Analyser & Code Fix Tests
run: dotnet test src/Stravaig.Extensions.Core.Analyzer.Tests/Stravaig.Extensions.Core.Analyzer.Tests.csproj --configuration Release
- name: Package Preview Release
if: ${{ env.STRAVAIG_IS_PREVIEW == 'true' }}
run: dotnet pack ./src/$STRAVAIG_PROJECT/$STRAVAIG_PROJECT.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_PROJECT/$STRAVAIG_PROJECT.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
- 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@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
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
- 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] Update metadata post v${{ env.STRAVAIG_PACKAGE_FULL_VERSION }} release."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}