Merge pull request #618 from Krypton-Suite/alpha-fallout-fixes #245
This file contains hidden or 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: Build | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| paths-ignore: | |
| - '.git*' | |
| - '.vscode/**' | |
| - 'Documents/**' | |
| - 'dictionary-en-gb/**' | |
| pull_request: | |
| branches: | |
| - alpha | |
| - master | |
| - canary | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Toolkit | |
| runs-on: windows-latest | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Checkout Standard-Toolkit (sibling) | |
| shell: pwsh | |
| run: ./Scripts/CI/Checkout-StandardToolkit.ps1 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: | | |
| 10.0.x | |
| 9.0.x | |
| 8.0.x | |
| - name: Setup .NET 11 (stable) | |
| id: setup_dotnet11_stable | |
| continue-on-error: true | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: ${{ vars.DOTNET_PREVIEW_SETUP_VERSION != '' && vars.DOTNET_PREVIEW_SETUP_VERSION || '11.0.x' }} | |
| - name: Setup .NET 11 (preview fallback) | |
| if: steps.setup_dotnet11_stable.outcome == 'failure' | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: ${{ vars.DOTNET_PREVIEW_SETUP_VERSION != '' && vars.DOTNET_PREVIEW_SETUP_VERSION || '11.0.x' }} | |
| dotnet-quality: preview | |
| - name: Pin SDK via global.json | |
| shell: pwsh | |
| run: ./Scripts/CI/Pin-DotNetSdk.ps1 | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v3 | |
| with: | |
| msbuild-architecture: x64 | |
| - name: Cache NuGet | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Resolve channel | |
| id: channel | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Stop' | |
| $branch = if ($env:GITHUB_EVENT_NAME -eq 'pull_request') { $env:GITHUB_BASE_REF } else { $env:GITHUB_REF_NAME } | |
| $config = 'Nightly' | |
| $proj = 'Scripts/Build/nightly.proj' | |
| switch -Regex ($branch) { | |
| '^(master|main)$' { $config = 'Release'; $proj = 'Scripts/Build/build.proj' } | |
| '^canary$' { $config = 'Canary'; $proj = 'Scripts/Build/canary.proj' } | |
| } | |
| Write-Host "Branch=$branch Configuration=$config Project=$proj" | |
| echo "configuration=$config" >> $env:GITHUB_OUTPUT | |
| echo "project=$proj" >> $env:GITHUB_OUTPUT | |
| - name: Print diagnostics | |
| run: | | |
| dotnet --list-sdks | |
| dotnet --info | |
| msbuild -version | |
| - name: Restore | |
| run: dotnet restore "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" -p:Configuration=${{ steps.channel.outputs.configuration }} | |
| - name: Build | |
| run: msbuild /m "${{ steps.channel.outputs.project }}" /t:Build /p:Configuration=${{ steps.channel.outputs.configuration }} /p:Platform="Any CPU" /p:Restore=false | |
| - name: Upload build artifacts | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Build-${{ steps.channel.outputs.configuration }} | |
| path: Bin/${{ steps.channel.outputs.configuration }}/ | |
| retention-days: 7 | |
| if-no-files-found: ignore |