Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 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
30 changes: 30 additions & 0 deletions .github/scripts/BuildProject.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
param (
[string]$Project,
[string]$Head,
[string]$Configuration
)

# Calculate the fully qualified project name
if ($Project -eq "Riverside.Extensions.WinUI") {
$FullyQualifiedName = "Riverside.Extensions.$Head"
} else {
$FullyQualifiedName = "$($Project -replace '\.Toolkit\.', ".Toolkit.$Head.")"
}

# Define the project directory
$ScriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
$ProjectRoot = Join-Path -Path $ScriptDirectory -ChildPath "..\.."
$ProjectDirectory = Join-Path -Path $ProjectRoot -ChildPath "src\platforms\$FullyQualifiedName"

# Check if the project directory exists
if (-Not (Test-Path -Path $ProjectDirectory)) {
Write-Output "Project directory '$ProjectDirectory' does not exist, skipping build."
exit 0
}

msbuild $ProjectDirectory /t:Restore /p:Configuration=$Configuration
# Run MSBuild
msbuild $ProjectDirectory /t:Build /p:Configuration=$Configuration /p:Platform=x64

# Return to the original location
Pop-Location
59 changes: 59 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CD

on:
workflow_dispatch:
pull_request:
branches:
- main

jobs:
build:
name: Publish
runs-on: windows-latest
environment: NuGet
strategy:
fail-fast: false
matrix:
configuration: [Release]
platform: [Any CPU]
env:
WORKING_DIR: ${{ github.workspace }}
SOLUTION_PATH: '${{ github.workspace }}\CubeKit.sln'
HEAD_PROJECTS_DIR: '${{ github.workspace }}\src\platforms'
HEAD_EXTENSIONS_DIR: '${{ github.workspace }}\src\extensions'
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.platform }}

steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x

- name: Restore project
shell: pwsh
run: |
msbuild $env:SOLUTION_PATH `
-t:Restore `
-p:Platform=$env:ARCHITECTURE `
-p:Configuration=$env:CONFIGURATION

- name: Build CubeKit
run: |
msbuild "$env:SOLUTION_PATH" `
-t:Build `
-p:Platform=$env:ARCHITECTURE `
-p:Configuration=$env:CONFIGURATION

- name: Package CubeKit
run: dotnet pack ${{ env.PACKAGE_PROJECT_PATH }} --configuration Release --no-build -o ./output

- name: Publish package to NuGet
run: dotnet nuget push ./output/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
# TODO: Publish symbols as well
107 changes: 107 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: CI

on:
push:
branches:
- main
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'

# The run name, either 'CubeKit PR Validation' if via a PR, or just 'CubeKit CI' if activated another way.
run-name: ${{ github.event_name == 'pull_request' && 'CubeKit PR Validation' || 'CubeKit CI' }}

# Environment variables. No values should be hardcoded, they should all be accessible as an environment variable.
env:
# MSBuild file locations
WORKING_DIR: ${{ github.workspace }}
SOLUTION_PATH: '${{ github.workspace }}\CubeKit.sln'
HEAD_PROJECTS_DIR: '${{ github.workspace }}\src\platforms'
HEAD_EXTENSIONS_DIR: '${{ github.workspace }}\src\extensions'
# Build configurations and tests
AUTOMATED_TESTS_ARCHITECTURE: 'x64'
AUTOMATED_TESTS_CONFIGURATION: 'Release'
# AUTOMATED_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests'
# AUTOMATED_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj'
# AUTOMATED_TESTS_ASSEMBLY_DIR: '${{ github.workspace }}\artifacts\TestsAssembly'
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'

# Runner jobs
jobs:
# This is a simple workflow that checks the formatting of XAML.
# XAML is not used in many places in CubeKit, but ensuring that
# it is formatted is imperative nonetheless.
# TODO: Migrate this to a separate workflow in another repository
check-formatting:
name: Check Formatting

if: github.repository_owner == 'RiversideValley'

runs-on: windows-latest

steps:

- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup .NET 8
uses: actions/setup-dotnet@v4

- name: Install XamlStyler.Console
run: 'dotnet tool install --global XamlStyler.Console'

- name: Check XAML formatting
id: check-step
run: |
$changedFiles = (git diff --diff-filter=d --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"}
foreach ($file in $changedFiles)
{
xstyler -p -l None -f $file
if ($LASTEXITCODE -ne 0)
{
echo "::error file=$file::Format check failed"
}
}
continue-on-error: true

- name: Fail if necessary
if: steps.check-step.outcome == 'failure'
run: exit 1

build:
name: Build

if: github.repository_owner == 'RiversideValley'

runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
core: [Riverside.Extensions.WinUI, Riverside.Toolkit.Animations, Riverside.Toolkit.Brushes, Riverside.Toolkit.Controls.Primitives, Riverside.Toolkit.Controls.TitleBar, Riverside.Toolkit.Converters, Riverside.Toolkit.Extensions, Riverside.Toolkit.Helpers, Riverside.Toolkit.Icons, Riverside.Toolkit.Services]
head: [Uno, Wpf, WinUI, Uwp]

env:
PROJECT: ${{ matrix.core }}
HEAD: ${{ matrix.head }}
CONFIGURATION: ${{ matrix.configuration }}

steps:

- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x

- name: Build project
shell: pwsh
run: '.github\scripts\BuildProject.ps1 -Project $env:PROJECT -Head $env:HEAD -Configuration $env:CONFIGURATION'
23 changes: 0 additions & 23 deletions CubeKit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35424.110
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riverside.GlowUI", "dev\Riverside.GlowUI\Riverside.GlowUI.csproj", "{39D58D51-829F-4259-BD22-E65BFFB7D7A1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riverside.GlowUI.Materials", "dev\Riverside.GlowUI.Materials\Riverside.GlowUI.Materials.csproj", "{E19D0B9E-25D9-49BD-8F1B-D3DA0C9C80D9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riverside.Toolkit.UITests", "tests\Riverside.Toolkit.UITests\Riverside.Toolkit.UITests.csproj", "{3A31D3ED-B0A5-4023-9E49-7E5F809094D5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{58CE73C0-AA7E-43B7-AD2E-B66182029009}"
Expand Down Expand Up @@ -65,10 +61,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riverside.Toolkit.WinUI.Ico
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riverside.Toolkit.WinUI.Services", "src\platforms\Riverside.Toolkit.WinUI.Services\Riverside.Toolkit.WinUI.Services.csproj", "{5D3784A7-CC3B-43FE-8AF3-8C996ADBC4E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riverside.Toolkit.Flyouts", "dev\Riverside.Toolkit.Flyouts\Riverside.Toolkit.Flyouts.csproj", "{B1BBC377-DAE1-4638-5A7A-2AB159EE8BB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dev", "dev", "{2E2D7A71-B62D-4EE3-AC3E-1AECF61D0583}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{91BB25A0-AA77-4B6C-A101-2717467BA888}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Riverside.Extensions.WinUI", "src\core\Riverside.Extensions.WinUI\Riverside.Extensions.WinUI.shproj", "{A33F78A1-9797-47F2-A93E-BA1963E3C0BD}"
Expand Down Expand Up @@ -167,14 +159,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{39D58D51-829F-4259-BD22-E65BFFB7D7A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39D58D51-829F-4259-BD22-E65BFFB7D7A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39D58D51-829F-4259-BD22-E65BFFB7D7A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39D58D51-829F-4259-BD22-E65BFFB7D7A1}.Release|Any CPU.Build.0 = Release|Any CPU
{E19D0B9E-25D9-49BD-8F1B-D3DA0C9C80D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E19D0B9E-25D9-49BD-8F1B-D3DA0C9C80D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E19D0B9E-25D9-49BD-8F1B-D3DA0C9C80D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E19D0B9E-25D9-49BD-8F1B-D3DA0C9C80D9}.Release|Any CPU.Build.0 = Release|Any CPU
{3A31D3ED-B0A5-4023-9E49-7E5F809094D5}.Debug|Any CPU.ActiveCfg = Debug|x64
{3A31D3ED-B0A5-4023-9E49-7E5F809094D5}.Debug|Any CPU.Build.0 = Debug|x64
{3A31D3ED-B0A5-4023-9E49-7E5F809094D5}.Debug|Any CPU.Deploy.0 = Debug|x64
Expand Down Expand Up @@ -233,10 +217,6 @@ Global
{5D3784A7-CC3B-43FE-8AF3-8C996ADBC4E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D3784A7-CC3B-43FE-8AF3-8C996ADBC4E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D3784A7-CC3B-43FE-8AF3-8C996ADBC4E1}.Release|Any CPU.Build.0 = Release|Any CPU
{B1BBC377-DAE1-4638-5A7A-2AB159EE8BB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1BBC377-DAE1-4638-5A7A-2AB159EE8BB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1BBC377-DAE1-4638-5A7A-2AB159EE8BB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1BBC377-DAE1-4638-5A7A-2AB159EE8BB8}.Release|Any CPU.Build.0 = Release|Any CPU
{1846753E-E9A5-43C1-9BD5-75E96FAA7273}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1846753E-E9A5-43C1-9BD5-75E96FAA7273}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1846753E-E9A5-43C1-9BD5-75E96FAA7273}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -342,8 +322,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{39D58D51-829F-4259-BD22-E65BFFB7D7A1} = {2E2D7A71-B62D-4EE3-AC3E-1AECF61D0583}
{E19D0B9E-25D9-49BD-8F1B-D3DA0C9C80D9} = {2E2D7A71-B62D-4EE3-AC3E-1AECF61D0583}
{3A31D3ED-B0A5-4023-9E49-7E5F809094D5} = {ECDCDFAD-F6D7-4A50-9EA1-B50C7DC6DFC7}
{19B394FA-B98D-48A5-8F1E-B26A9C8B5D02} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{8EBAEA2A-405D-4F0F-ADCA-CEA72D53A527} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
Expand All @@ -367,7 +345,6 @@ Global
{245D1074-ABD4-456C-95D8-6C5F06CB6C9E} = {AA619411-1D80-4167-9BB6-84534B676BEB}
{81666F0E-D457-4634-84BB-20DF6D4CCFF4} = {AA619411-1D80-4167-9BB6-84534B676BEB}
{5D3784A7-CC3B-43FE-8AF3-8C996ADBC4E1} = {AA619411-1D80-4167-9BB6-84534B676BEB}
{B1BBC377-DAE1-4638-5A7A-2AB159EE8BB8} = {2E2D7A71-B62D-4EE3-AC3E-1AECF61D0583}
{91BB25A0-AA77-4B6C-A101-2717467BA888} = {58CE73C0-AA7E-43B7-AD2E-B66182029009}
{A33F78A1-9797-47F2-A93E-BA1963E3C0BD} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{1846753E-E9A5-43C1-9BD5-75E96FAA7273} = {91BB25A0-AA77-4B6C-A101-2717467BA888}
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' or '$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(IsUwpProject)' == 'true'">
<PackageReference Include="Microsoft.Windows.SDK.CPP" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(ToolingDirectory)\GlobalUsings.cs" />
Expand Down
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
<PackageVersion Include="iNKORE.UI.WPF" Version="1.2.8" />
<PackageVersion Include="Microsoft.Graphics.Win2D" Version="1.3.1" />
<PackageVersion Include="Microsoft.TestPlatform.TestHost" Version="17.12.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.8.7" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2957.106" />
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.183" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
<PackageVersion Include="Microsoft.Windows.SDK.CPP" Version="10.0.26100.2454" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.7.0" />
<PackageVersion Include="MSTest.TestFramework" Version="3.7.0" />
Expand Down
9 changes: 9 additions & 0 deletions eng/PackageMetadata.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
<PackageIcon>PackageLogo.png</PackageIcon>
</PropertyGroup>

<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<None Include="$(SourceDirectory)\README.md">
<Pack>True</Pack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0-windows</TargetFrameworks>
<IsAotCompatible>true</IsAotCompatible>
<IsAotCompatible Condition="'$(TargetFramework)' == 'net8.0-windows'">true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading