Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,121 @@ jobs:

- 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 dynamisch erzeugen
- 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 }}
1 change: 1 addition & 0 deletions Documents/Changelog/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
====

## 2025-11-xx - Build 2511 (V10 - alpha) - November 2025
* Implemented [#2503](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2503), Add the ability to create zip files for binaries
* Resolved [#2492](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2492), `KryptonForm` does not display '(Administrator)' when elevated
* Resolved [#2502](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2502), **[Breaking Change]** `KryptonCommandLinkButton` updates several properties and their behaviour. See issue for full details.
* Resolved [#2495](https://github.com/Krypton-Suite/Standard-Toolkit/issues/2495), `KryptonProgressBar` private field `_mementoContent` can be null.
Expand Down
65 changes: 58 additions & 7 deletions Scripts/build.proj
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<RootFolder>$(MSBuildProjectDirectory)</RootFolder>
<Configuration>Release</Configuration>
<ReleaseBuildPath>..\Bin\Release\Zips</ReleaseBuildPath>
<ReleaseZipName>Krypton-Release</ReleaseZipName>
</PropertyGroup>

<Target Name="Clean">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Clean" />
</Target>
</Target>

<Target Name="Restore">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Restore" />
</Target>

<Target Name="Build" DependsOnTargets="Restore">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" />
</Target>

<Target Name="CleanPackages">
<ItemGroup>
<NugetPkgs Include="..\Bin\Release\*.nupkg" />
Expand All @@ -49,7 +51,7 @@
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=lite" Targets="Restore" />
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=lite" Targets="Pack" />
</Target>

<Target Name="PackAll">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
Expand All @@ -65,13 +67,62 @@
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Restore" />
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Pack" />
</Target>

<Target Name="Pack" DependsOnTargets="CleanPackages;PackLite;PackAll" />

<Target Name="Push">
<ItemGroup>
<NugetPkgs Include="..\Bin\Release\*.$(LibraryVersion).nupkg" />
</ItemGroup>
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
</Target>

<Target Name="CreateReleaseZip">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Release\**\*.*" Exclude="..\Bin\Release\*vshost.exe*;..\Bin\Release\**\*.json;..\Bin\Release\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(ReleaseBuildPath)"/>

<!-- Using 7-Zip for ZIP creation (compatible with all MSBuild versions) -->
<Exec Command="7z.exe a -tzip &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).zip&quot; &quot;..\Bin\Release\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(ReleaseBuildPath)" />

<!-- Fallback: Using PowerShell Compress-Archive if 7-Zip not available -->
<Exec Command="powershell.exe -Command &quot;Get-ChildItem '..\Bin\Release\*' -Recurse | Where-Object {$_.Extension -notin '.json','.pdb'} | Compress-Archive -DestinationPath '$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).zip' -Force&quot;"
Condition="!Exists('C:\Program Files\7z.exe')" />
</Target>

<Target Name="CreateReleaseTar">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Release\**\*.*" Exclude="..\Bin\Release\*vshost.exe*;..\Bin\Release\**\*.json;..\Bin\Release\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(ReleaseBuildPath)"/>

<!-- Method 1: Using 7-Zip if available (recommended for Windows) -->
<Exec Command="7z.exe a -ttar &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar&quot; &quot;..\Bin\Release\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(ReleaseBuildPath)" />
<Exec Command="7z.exe a -tgzip &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar.gz&quot; &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar&quot;"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(ReleaseBuildPath)" />
<Delete Files="$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate).tar"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')" />

<!-- Method 2: Using PowerShell tar command (Windows 10/11) -->
<Exec Command="powershell.exe -Command tar -czf &quot;$(ReleaseBuildPath)\$(ReleaseZipName)_$(StringDate)_ps.tar.gz&quot; -C &quot;..\Bin\Release&quot; . --exclude=*.json --exclude=*.pdb"
Condition="Exists('C:\Windows\System32\tar.exe')" />

<!-- Method 3: Using Git Bash tar if available -->
<Exec Command="&quot;C:\Program Files\Git\bin\bash.exe&quot; -c &quot;cd ../Bin/Release &amp;&amp; tar -czf &quot;$(ReleaseBuildPath)/$(ReleaseZipName)_$(StringDate)_git.tar.gz&quot; * --exclude=*.json --exclude=*.pdb&quot;"
Condition="Exists('C:\Program Files\Git\bin\bash.exe')" />
</Target>

<Target Name="CreateAllReleaseArchives" DependsOnTargets="CreateReleaseZip;CreateReleaseTar" />
</Project>
70 changes: 55 additions & 15 deletions Scripts/canary.proj
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<RootFolder>$(MSBuildProjectDirectory)</RootFolder>
<Configuration>Canary</Configuration>
<CanaryBuildPath>..\Bin\Canary\Zips</CanaryBuildPath>
<CanaryZipName>Krypton-Canary</CanaryZipName>
</PropertyGroup>

<Target Name="Clean">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Clean" />
</Target>
</Target>

<Target Name="Restore">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Restore" />
</Target>

<Target Name="Build" DependsOnTargets="Restore">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" />
</Target>

<Target Name="CleanPackages">
<ItemGroup>
<NugetPkgs Include="..\Bin\Canary\*.nupkg" />
</ItemGroup>
<Delete Files="@(NugetPkgs)" />
</Target>

<Target Name="PackAll">
<ItemGroup>
<Projects Include="..\Source\Krypton Components\Krypton.*\*.csproj" />
Expand All @@ -49,27 +51,65 @@
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Restore" />
<MSBuild Projects="@(Projects)" Properties="Configuration=$(Configuration);TFMs=all" Targets="Pack" />
</Target>

<Target Name="Pack" DependsOnTargets="CleanPackages;PackAll" /> <!--PackLite;-->


<Target Name="Pack" DependsOnTargets="CleanPackages;PackAll" />
<!--PackLite;-->

<Target Name="Push">
<ItemGroup>
<NugetPkgs Include="..\Bin\Canary\*.$(LibraryVersion).nupkg" />
</ItemGroup>
<Exec Command="nuget.exe push %(NugetPkgs.Identity)" />
</Target>

<Target Name="CreateNightlyZip">


<Target Name="CreateCanaryZip">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Canary\**\*.*" Exclude="..\Bin\Canary\*vshost.exe*;..\Bin\Canary\**\*.json;..\Bin\Canary\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(CanaryBuildPath)"/>

<!-- Using 7-Zip for ZIP creation (compatible with all MSBuild versions) -->
<Exec Command="7z.exe a -tzip &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).zip&quot; &quot;..\Bin\Canary\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(CanaryBuildPath)" />

<!-- Fallback: Using PowerShell Compress-Archive if 7-Zip not available -->
<Exec Command="powershell.exe -Command &quot;Get-ChildItem '..\Bin\Canary\*' -Recurse | Where-Object {$_.Extension -notin '.json','.pdb'} | Compress-Archive -DestinationPath '$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).zip' -Force&quot;"
Condition="!Exists('C:\Program Files\7z.exe')" />
</Target>

<Target Name="CreateCanaryTar">
<PropertyGroup>
<StringDate>$([System.DateTime]::Now.ToString('yyyyMMdd'))</StringDate>
</PropertyGroup>
<ItemGroup>
<DebugApplicationFiles Include="..\Bin\Canary\**\*.*" Exclude="..\Bin\Canary\*vshost.exe*" />
<DebugApplicationFiles Include="..\Bin\Canary\**\*.*" Exclude="..\Bin\Canary\*vshost.exe*;..\Bin\Canary\**\*.json;..\Bin\Canary\**\*.pdb" />
</ItemGroup>
<MakeDir Directories="$(NightlyBuildPath)"/>
<Zip Files="@(DebugApplicationFiles)"
WorkingDirectory="..\Bin\Canary"
ZipFileName="$(NightlyBuildPath)\$(StringDate)_$(NightlyZipName).zip"
ZipLevel="9" />
<MakeDir Directories="$(CanaryBuildPath)"/>

<!-- Method 1: Using 7-Zip if available (recommended for Windows) -->
<Exec Command="7z.exe a -ttar &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar&quot; &quot;..\Bin\Canary\*&quot; -x!*.json -x!*.pdb"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(CanaryBuildPath)" />
<Exec Command="7z.exe a -tgzip &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar.gz&quot; &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar&quot;"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')"
WorkingDirectory="$(CanaryBuildPath)" />
<Delete Files="$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate).tar"
Condition="Exists('C:\Program Files\7-Zip\7z.exe')" />

<!-- Method 2: Using PowerShell tar command (Windows 10/11) -->
<Exec Command="powershell.exe -Command tar -czf &quot;$(CanaryBuildPath)\$(CanaryZipName)_$(StringDate)_ps.tar.gz&quot; -C &quot;..\Bin\Canary&quot; . --exclude=*.json --exclude=*.pdb"
Condition="Exists('C:\Windows\System32\tar.exe')" />

<!-- Method 3: Using Git Bash tar if available -->
<Exec Command="&quot;C:\Program Files\Git\bin\bash.exe&quot; -c &quot;cd ../Bin/Canary &amp;&amp; tar -czf &quot;$(CanaryBuildPath)/$(CanaryZipName)_$(StringDate)_git.tar.gz&quot; * --exclude=*.json --exclude=*.pdb&quot;"
Condition="Exists('C:\Program Files\Git\bin\bash.exe')" />
</Target>

<Target Name="CreateAllCanaryArchives" DependsOnTargets="CreateCanaryZip;CreateCanaryTar" />
</Project>
Loading
Loading