* Remove #648 (V100) (#2558) #207
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
# New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE) | |
# Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), tobitege et al. 2025 - 2025. All rights reserved. | |
name: Build | |
on: | |
pull_request: | |
branches: ['**'] | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- master | |
- alpha | |
- canary | |
- gold | |
- V95 | |
- V85-LTS | |
paths-ignore: ['.git*', '.vscode'] | |
jobs: | |
build: | |
runs-on: windows-2022 | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
# .NET 9 (GA) | |
- name: Setup .NET 9 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
# .NET 10 (Preview) | |
- name: Setup .NET 10 (preview) | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 10.0.x | |
dotnet-quality: preview | |
# global.json dynamically generate | |
- name: Force .NET 10 SDK via global.json | |
run: | | |
$sdkVersion = (dotnet --list-sdks | Select-String "10.0").ToString().Split(" ")[0] | |
Write-Output "Using SDK $sdkVersion" | |
@" | |
{ | |
"sdk": { | |
"version": "$sdkVersion", | |
"rollForward": "latestFeature" | |
} | |
} | |
"@ | Out-File -Encoding utf8 global.json | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
msbuild-architecture: x64 | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
- name: Cache NuGet | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Restore | |
run: dotnet restore "Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln" | |
- name: Build | |
run: msbuild "Scripts/nightly.proj" /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU" | |
release: | |
runs-on: windows-2022 | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
# .NET 9 (GA) | |
- name: Setup .NET 9 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
# .NET 10 (Preview) | |
- name: Setup .NET 10 (preview) | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 10.0.x | |
dotnet-quality: preview | |
# global.json dynamically generate | |
- name: Force .NET 10 SDK via global.json | |
run: | | |
$sdkVersion = (dotnet --list-sdks | Select-String "10.0").ToString().Split(" ")[0] | |
Write-Output "Using SDK $sdkVersion" | |
@" | |
{ | |
"sdk": { | |
"version": "$sdkVersion", | |
"rollForward": "latestFeature" | |
} | |
} | |
"@ | Out-File -Encoding utf8 global.json | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
msbuild-architecture: x64 | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
- name: Cache NuGet | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Restore | |
run: dotnet restore "Source/Krypton Components/Krypton Toolkit Suite 2022 - VS2022.sln" | |
- name: Build Release | |
run: msbuild "Scripts/build.proj" /t:Build /p:Configuration=Release /p:Platform="Any CPU" | |
- name: Pack Release | |
run: msbuild "Scripts/build.proj" /t:Pack /p:Configuration=Release /p:Platform="Any CPU" | |
- name: Create Release Archives | |
run: msbuild "Scripts/build.proj" /t:CreateAllReleaseArchives /p:Configuration=Release /p:Platform="Any CPU" | |
- name: Get Version | |
id: get_version | |
run: | | |
$version = (dotnet build "Source/Krypton Components/Krypton.Toolkit/Krypton.Toolkit.csproj" --no-restore --verbosity quiet | Select-String "Version" | ForEach-Object { $_.Line.Split('=')[1].Trim() }) | |
if (-not $version) { | |
$version = "100.25.1.1" # Fallback version | |
} | |
echo "version=$version" >> $env:GITHUB_OUTPUT | |
echo "tag=v$version" >> $env:GITHUB_OUTPUT | |
- name: Create Release | |
run: | | |
$releaseBody = @" | |
## Krypton Toolkit Suite Release ${{ steps.get_version.outputs.version }} | |
This release includes: | |
- All Krypton Toolkit components | |
- NuGet packages for multiple target frameworks | |
- Release archives (ZIP and TAR.GZ formats) | |
### Downloads | |
- **ZIP Archive**: `Krypton-Release_*.zip` | |
- **TAR.GZ Archive**: `Krypton-Release_*.tar.gz` | |
### Target Frameworks | |
- .NET Framework 4.7.2 | |
- .NET Framework 4.8 | |
- .NET Framework 4.8.1 | |
- .NET 8.0 Windows | |
- .NET 9.0 Windows | |
- .NET 10.0 Windows | |
"@ | |
gh release create ${{ steps.get_version.outputs.tag }} ` | |
--title "Release ${{ steps.get_version.outputs.version }}" ` | |
--notes "$releaseBody" ` | |
--latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release Assets | |
run: | | |
$zipFile = Get-ChildItem "Bin/Release/Zips/Krypton-Release_*.zip" | Select-Object -First 1 | |
$tarFile = Get-ChildItem "Bin/Release/Zips/Krypton-Release_*.tar.gz" | Select-Object -First 1 | |
if ($zipFile) { | |
gh release upload ${{ steps.get_version.outputs.tag }} "$($zipFile.FullName)" --clobber | |
} | |
if ($tarFile) { | |
gh release upload ${{ steps.get_version.outputs.tag }} "$($tarFile.FullName)" --clobber | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |