Skip to content

Commit 6c26872

Browse files
committed
CI
1 parent bfc987f commit 6c26872

8 files changed

Lines changed: 105 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Check-Build
2+
3+
on: [push]
4+
5+
jobs:
6+
build-publish:
7+
runs-on: windows-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- name: Setup GitHub CLI
12+
uses: cli/cli@v2
13+
14+
- name: Download and extract plugins
15+
shell: pwsh
16+
run: |
17+
$plugins = @(
18+
"plugin_Kinect360NiTE",
19+
"plugin_OpenVR"
20+
)
21+
22+
New-Item -ItemType Directory -Force -Path artifacts | Out-Null
23+
New-Item -ItemType Directory -Force -Path Plugins | Out-Null
24+
25+
foreach ($plugin in $plugins) {
26+
Write-Host "Downloading $plugin ..."
27+
gh release download --repo "KinectToVR/$plugin" --pattern "*.zip" --dir artifacts
28+
29+
Get-ChildItem artifacts -Filter *.zip | ForEach-Object {
30+
$dest = "Plugins/$plugin"
31+
New-Item -ItemType Directory -Force -Path $dest | Out-Null
32+
Expand-Archive -Path $_.FullName -DestinationPath $dest -Force
33+
Remove-Item $_.FullName
34+
}
35+
}
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Set up .NET
40+
uses: actions/setup-dotnet@v3
41+
with:
42+
dotnet-version: "10.0.x"
43+
44+
- name: Restore and build (publish) - Linux
45+
run: |
46+
dotnet publish Amethyst.Desktop `
47+
/p:Configuration=Release /p:TargetFramework=net8.0 /p:PublishProfile=FolderProfile `
48+
/p:RuntimeIdentifier=linux-x64 /p:SelfContained=true /p:PublishDir=bin/Release/linux
49+
50+
Copy-Item -Path "Plugins" -Destination "Amethyst.Desktop/bin/Release/linux/Plugins" -Recurse
51+
52+
cd Amethyst.Desktop/bin/Release/linux/
53+
7z a AME2-$(Get-Date -Format 'yyyyMMdd')-LINUX.zip *
54+
55+
- name: Restore and build (publish) - Windows
56+
run: |
57+
dotnet publish Amethyst.Desktop `
58+
/p:Configuration=Release /p:TargetFramework=net8.0 /p:PublishProfile=FolderProfile `
59+
/p:RuntimeIdentifier=win-x64 /p:SelfContained=true /p:PublishDir=bin/Release/windows
60+
61+
Copy-Item -Path "Plugins" -Destination "Amethyst.Desktop/bin/Release/windows/Plugins" -Recurse
62+
63+
cd Amethyst.Desktop/bin/Release/windows/
64+
7z a AME2-$(Get-Date -Format 'yyyyMMdd')-WINDOWS.zip *
65+
66+
- name: Upload artifacts
67+
uses: "marvinpinto/action-automatic-releases@latest"
68+
with:
69+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
70+
automatic_release_tag: "ame2-latest"
71+
prerelease: true
72+
title: "AME2 Build Artifact"
73+
files: |
74+
./Amethyst.Desktop/bin/Release/linux/AME2-*-LINUX.zip
75+
./Amethyst.Desktop/bin/Release/windows/AME2-*-WINDOWS.zip

Amethyst.Contract/Amethyst.Contract.csproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<TargetFramework>net8.0</TargetFramework>
54
<ImplicitUsings>enable</ImplicitUsings>
@@ -15,11 +14,7 @@
1514
<Authors>K2VR</Authors>
1615
<Company>K2VR</Company>
1716
<PackageTags>Amethyst;K2VR;KinectToVR;VR;OpenVR;Fullbody Tracking</PackageTags>
18-
<Description>
19-
This client class library lets you export your plugin library for Amethyst with MEF.
20-
Compatible with C# (with XAML via WinUI/WinRT), C++/CLI, and custom WinRT projections.
21-
Contains additional functions and helper classes to make plugin developmnet easier.
22-
</Description>
17+
<Description>This client class library lets you export your plugin library for Amethyst (AME2) with MEF. Compatible with dotnet. Contains additional functions and helper classes to make plugin developmnet easier.</Description>
2318
<PackageIcon>ktvr.png</PackageIcon>
2419
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2520
<RequireLicenseAcceptance>true</RequireLicenseAcceptance>
@@ -29,7 +24,7 @@
2924

3025
<ItemGroup>
3126
<PackageReference Include="Avalonia" Version="11.3.2"/>
32-
<PackageReference Include="Avalonia.Labs.Controls" Version="11.3.1" />
27+
<PackageReference Include="Avalonia.Labs.Controls" Version="11.3.1"/>
3328
<PackageReference Include="Xaml.Behaviors.Avalonia" Version="11.3.2"/>
3429
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
3530
<PackageReference Include="Splat" Version="16.2.1"/>
@@ -38,5 +33,4 @@
3833
<ItemGroup>
3934
<None Include="Assets\ktvr.png" Pack="true" PackagePath="\"/>
4035
</ItemGroup>
41-
4236
</Project>

Amethyst.Desktop/Amethyst.Desktop.csproj

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
3-
<TargetFramework>net8.0</TargetFramework>
4-
</PropertyGroup>
5-
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
6-
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
7-
</PropertyGroup>
8-
92
<PropertyGroup>
10-
<OutputType>WinExe</OutputType>
3+
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<OutputType>Exe</OutputType>
115
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
126
<ApplicationManifest>app.manifest</ApplicationManifest>
137
<NoWarn>$(NoWarn);NU1507</NoWarn>
148
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
159
</PropertyGroup>
10+
1611
<ItemGroup>
1712
<None Remove=".gitignore"/>
1813
</ItemGroup>

Amethyst.Desktop/Program.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Amethyst.Desktop;
1111

1212
internal class Program
1313
{
14-
public static INotificationManager NotificationManager = null!;
14+
public static INotificationManager NotificationManager = null;
1515

1616
// Initialization code. Don't use any Avalonia, third-party APIs or any
1717
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
@@ -24,20 +24,26 @@ public static void Main(string[] args) => BuildAvaloniaApp()
2424
public static AppBuilder BuildAvaloniaApp()
2525
=> AppBuilder.Configure(() => new App(NotificationManager))
2626
.UsePlatformDetect()
27-
.SetupDesktopNotifications(out NotificationManager!)
27+
.SetupShellHandlers()
28+
// .SetupDesktopNotifications(out NotificationManager!)
2829
.LogToTrace();
2930
}
3031

3132
public static class AppBuilderExtensions
3233
{
3334
private static ISystemShell Shell { get; set; }
3435

35-
public static AppBuilder SetupDesktopNotifications(this AppBuilder builder, out INotificationManager manager)
36+
public static AppBuilder SetupShellHandlers(this AppBuilder builder)
3637
{
3738
if (OperatingSystem.IsWindows()) Shell = new SystemShellWindows();
3839
else if (OperatingSystem.IsMacCatalyst() || OperatingSystem.IsMacOS()) Shell = new SystemShellMac();
3940
else if (OperatingSystem.IsLinux()) Shell = new SystemShellLinux();
4041

42+
return builder;
43+
}
44+
45+
public static AppBuilder SetupDesktopNotifications(this AppBuilder builder, out INotificationManager manager)
46+
{
4147
// ReSharper disable once SwitchStatementHandlesSomeKnownEnumValuesWithDefault
4248
switch (Environment.OSVersion.Platform)
4349
{
@@ -60,7 +66,7 @@ public static AppBuilder SetupDesktopNotifications(this AppBuilder builder, out
6066
}
6167

6268
if (!OperatingSystem.IsMacCatalyst() && !OperatingSystem.IsMacOS())
63-
manager.Initialize().GetAwaiter().GetResult();
69+
manager?.Initialize().GetAwaiter().GetResult();
6470

6571
var notificationManager = manager;
6672
builder.AfterSetup(b =>

Amethyst/App.axaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,13 @@
145145
<sty:FluentAvaloniaTheme PreferSystemTheme="True" PreferUserAccentColor="{OnPlatform Windows='True', Default='False'}" />
146146

147147
<Style Selector=":is(TopLevel)">
148-
<Setter Property="FontFamily" Value="avares://Amethyst/Assets/Fonts#Inter" />
148+
<Setter Property="FontFamily">
149+
<Setter.Value>
150+
<OnPlatform x:TypeArguments="FontFamily" Windows="Segoe UI" Default="avares://Amethyst/Assets/Fonts#Inter"/>
151+
</Setter.Value>
152+
</Setter>
149153
</Style>
150-
154+
151155
<Style Selector="controls|FontIcon">
152156
<Setter Property="FontFamily" Value="avares://Amethyst/Assets/Fonts#Symbols" />
153157
</Style>

Amethyst/MainWindow.axaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ColumnDefinitions="Auto,Auto,*,Auto,Auto"
1616
Background="Transparent"
1717
PointerPressed="TitleBarHost_OnPointerPressed">
18-
<Image Margin="16,4,12,4"
18+
<Image Margin="15,4,12,4"
1919
IsHitTestVisible="False"
2020
Source="/Assets/ktvr.ico"
2121
Width="18" Height="18"
@@ -34,6 +34,7 @@
3434
</Border>
3535

3636
<StackPanel Grid.Column="4" VerticalAlignment="Center"
37+
IsVisible="{OnPlatform Windows='False', Default='True'}"
3738
Orientation="Horizontal" Spacing="4" Margin="0,0,4,0">
3839
<Button Height="34" Width="34" BorderThickness="0" Background="Transparent"
3940
Click="MinimizeButton_OnClick">

Amethyst/Views/MicaWindow.axaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ public MicaWindow()
2323
this.AttachDevTools();
2424
#endif
2525

26-
// TitleBar.ExtendsContentIntoTitleBar = true;
27-
// TitleBar.TitleBarHitTestType = TitleBarHitTestType.Complex;
26+
if (OperatingSystem.IsWindows())
27+
{
28+
TitleBar.ExtendsContentIntoTitleBar = true;
29+
TitleBar.TitleBarHitTestType = TitleBarHitTestType.Complex;
30+
}
2831

2932
if (Application.Current != null)
3033
Application.Current.ActualThemeVariantChanged += OnActualThemeVariantChanged;

Amethyst/Views/SplashScreen.axaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
Background="Transparent">
1313

1414
<Button Height="34" Width="34" BorderThickness="0" Background="Transparent" Margin="4"
15+
IsVisible="{OnPlatform Windows='False', Default='True'}"
1516
Click="CloseButton_OnClick" HorizontalAlignment="Right" VerticalAlignment="Top">
1617
<Button.Content>
1718
<controls:FontIcon Glyph="&#xE8BB;" FontSize="13" />
@@ -55,4 +56,4 @@
5556
FontSize="14" />
5657
</Grid>
5758
</Panel>
58-
</UserControl>
59+
</UserControl>

0 commit comments

Comments
 (0)