Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into action/deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
zdpcdt committed Jul 10, 2024
2 parents b35593c + 8672c7d commit a88d7f1
Show file tree
Hide file tree
Showing 228 changed files with 13,184 additions and 849 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Deploy to GitHub Pages

env:
PROJECT_PATH: demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
OUTPUT_PATH: demo/Ursa.Demo.Browser/bin/Release/net7.0/browser-wasm/AppBundle
OUTPUT_PATH: demo/Ursa.Demo.Browser/bin/Release/net8.0-browser/publish/wwwroot
on:
push:
branches: [ "deploy" ]
branches: [ "action/deploy" ]
pull_request:
branches: [ "deploy" ]
branches: [ "action/deploy" ]

jobs:
deploy-to-github-pages:
Expand All @@ -16,32 +16,23 @@ jobs:
- name: Checkout
uses: actions/[email protected]

- name: Setup .NET 7
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.405
dotnet-version: 8.0.x

- name: Install wasm-tools
run: dotnet workload install wasm-tools wasm-tools-net7

- name: Install DotNetCompress
run: dotnet tool install --global DotNetCompress --version 3.0.0 --no-cache
run: dotnet workload install wasm-tools

- name: Publish .NET Project
run: dotnet publish $PROJECT_PATH -c Release -o release --nologo
run: dotnet publish $PROJECT_PATH -c Release --nologo

- name: Change base-tag in index.html
run: sed -i 's/<base href="\/" \/>/<base href="\/Ursa.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html

- name: copy index.html to 404.html
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html

- name: Compress Output using Brotli
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format br --threads 4

- name: Compress Output using GZip
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format gz --threads 4

- name: Add .nojekyll file
run: touch $OUTPUT_PATH/.nojekyll

Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Pack

on:
push:
branches: [ "action/pack" ]
pull_request:
branches: [ "action/pack" ]

jobs:
nuget_desktop:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Nuget Ursa
run: dotnet pack ./src/Ursa -o ./nugets

- name: Nuget Ursa.Themes.Semi
run: dotnet pack ./src/Ursa.Themes.Semi -o ./nugets

- name: Desktop
run: dotnet publish ./demo/Ursa.Demo.Desktop -r win-x64 -c Release /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: nuget_desktop
path: |
./nugets
./**/publish/*.exe
android:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: CD Android
run: cd ./demo/Ursa.Demo.Android

- name: Restore Dependencies
run: dotnet restore

- name: Build
run: dotnet publish ./demo/Ursa.Demo.Android -c Release -f net8.0-android --no-restore

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: android
path: ./**/publish/*Signed.apk
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Ursa is a UI library for building cross-platform UIs with Avalonia UI.

Add nuget package:
```bash
dotnet add package Irihi.Ursa --version 0.2.0-beta20240129
dotnet add package Irihi.Ursa
```

You can now use Ursa controls in your Avalonia Application.
Expand Down Expand Up @@ -42,7 +42,7 @@ Ursa.Themes.Semi is a theme package for Ursa inspired by Semi Design. You can ad
Add nuget package:
```bash
dotnet add package Semi.Avalonia --version 11.0.7
dotnet add package Irihi.Ursa.Themes.Semi --version 0.2.0-beta20240129
dotnet add package Irihi.Ursa.Themes.Semi
```

Include Styles in application:
Expand All @@ -56,3 +56,9 @@ Include Styles in application:
<u-semi:SemiTheme Locale="zh-CN"/>
</Application.Styles>
```

## Support

We offer limited free community support for Semi Avalonia and Ursa. Please join our group via FeiShu(Lark)

![Support](./assets/community-support.png)
6 changes: 6 additions & 0 deletions Ursa.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ursa.PrismExtension", "src\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ursa.PrismDialogDemo", "demo\Ursa.PrismDialogDemo\Ursa.PrismDialogDemo.csproj", "{F99B3D07-4560-4B05-892C-0FF2757FEF2E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{9D34CC2C-9BFA-4138-BA5A-CD3744F9B589}"
ProjectSection(SolutionItems) = preProject
src\Package.props = src\Package.props
demo\Directory.Build.props = demo\Directory.Build.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
Binary file added assets/community-support.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion demo/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.0.9</AvaloniaVersion>
<AvaloniaVersion>11.1.0-rc2</AvaloniaVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion demo/Ursa.Demo.Android/Ursa.Demo.Android.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-android</TargetFramework>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ApplicationId>com.irihitech.Ursa</ApplicationId>
Expand Down
4 changes: 2 additions & 2 deletions demo/Ursa.Demo.Browser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

namespace Ursa.Demo.Browser;

internal partial class Program
internal sealed partial class Program
{
private static async Task Main(string[] args) => await BuildAvaloniaApp()
private static Task Main(string[] args) => BuildAvaloniaApp()
.StartBrowserAppAsync("out");

public static AppBuilder BuildAvaloniaApp()
Expand Down
12 changes: 5 additions & 7 deletions demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-browser</TargetFramework>
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="AppBundle\**"/>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/>
<ProjectReference Include="..\Ursa.Demo\Ursa.Demo.csproj"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Ursa.Demo\Ursa.Demo.csproj"/>
<TrimmerRootDescriptor Include="linker.xml"/>
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions demo/Ursa.Demo.Browser/linker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<linker>
<assembly fullname="Semi.Avalonia, Version=11.1.0.0, Culture=neutral, PublicKeyToken=null"/>
<assembly fullname="Ursa, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null"/>
<assembly fullname="Ursa.Themes.Semi, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null"/>
</linker>
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="/" />
<link rel="modulepreload" href="./main.js" />
<link rel="modulepreload" href="./dotnet.js" />
<link rel="modulepreload" href="./avalonia.js" />
<link rel="modulepreload" href="./_framework/dotnet.js" />
<link rel="modulepreload" href="./_framework/avalonia.js" />
<link rel="stylesheet" href="./app.css" />
</head>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dotnet } from './dotnet.js'
import { dotnet } from './_framework/dotnet.js'

const is_browser = typeof window != "undefined";
if (!is_browser) throw new Error(`Expected to be running in a browser`);
Expand All @@ -10,4 +10,4 @@ const dotnetRuntime = await dotnet

const config = dotnetRuntime.getConfig();

await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]);
2 changes: 1 addition & 1 deletion demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<OutputType>WinExe</OutputType>
<!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects.
One for Windows with net7.0-windows TFM, one for MacOS with net7.0-macos and one with net7.0 TFM for Linux.-->
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
Expand Down
2 changes: 1 addition & 1 deletion demo/Ursa.Demo.iOS/Ursa.Demo.iOS.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-ios</TargetFramework>
<TargetFramework>net8.0-ios</TargetFramework>
<SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion demo/Ursa.Demo/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public override void OnFrameworkInitializationCompleted()
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView)
{
singleView.MainView = new MainView()
singleView.MainView = new SingleView()
{
DataContext = new MainViewViewModel(),
};
Expand Down
Binary file added demo/Ursa.Demo/Assets/3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion demo/Ursa.Demo/Converters/IconNameConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Ursa.Demo.Converters;
public class IconNameConverter: IValueConverter
{
[Content]
public Dictionary<string, PathGeometry> Paths { get; set; } = new();
public Dictionary<string, StreamGeometry> Paths { get; set; } = new();

public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
Expand Down
1 change: 1 addition & 0 deletions demo/Ursa.Demo/Dialogs/PlainDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
x:Class="Ursa.Demo.Dialogs.PlainDialog">
<StackPanel>
<Calendar SelectedDate="{Binding Date}" ></Calendar>
<TextBlock TextWrapping="Wrap" Text="{Binding Text}"></TextBlock>
</StackPanel>
</UserControl>
14 changes: 13 additions & 1 deletion demo/Ursa.Demo/Dialogs/PlainDialogViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,16 @@ public DateTime? Date
get => _date;
set => SetProperty(ref _date, value);
}
}

private string? _text;
public string? Text
{
get => _text;
set => SetProperty(ref _text, value);
}

public PlainDialogViewModel()
{
Text = "I am PlainDialogViewModel!";
}
}
36 changes: 0 additions & 36 deletions demo/Ursa.Demo/Models/MenuKeys.cs
Original file line number Diff line number Diff line change
@@ -1,36 +0,0 @@
namespace Ursa.Demo;

public static class MenuKeys
{
public const string MenuKeyIntroduction = "Introduction";
public const string MenuKeyBadge = "Badge";
public const string MenuKeyBanner = "Banner";
public const string MenuKeyButtonGroup = "ButtonGroup";
public const string MenuKeyClassInput = "Class Input";
public const string MenuKeyDialog = "Dialog";
public const string MenuKeyDivider = "Divider";
public const string MenuKeyDisableContainer = "DisableContainer";
public const string MenuKeyDrawer = "Drawer";
public const string MenuKeyDualBadge = "DualBadge";
public const string MenuKeyEnumSelector = "EnumSelector";
public const string MenuKeyForm = "Form";
public const string MenuKeyImageViewer = "ImageViewer";
public const string MenuKeyIpBox = "IPv4Box";
public const string MenuKeyIconButton = "IconButton";
public const string MenuKeyKeyGestureInput = "KeyGestureInput";
public const string MenuKeyLoading = "Loading";
public const string MenuKeyMessageBox = "MessageBox";
public const string MenuKeyNavMenu = "NavMenu";
public const string MenuKeyNumberDisplayer = "NumberDisplayer";
public const string MenuKeyNumericUpDown = "NumericUpDown";
public const string MenuKeyPagination = "Pagination";
public const string MenuKeyRangeSlider = "RangeSlider";
public const string MenuKeySelectionList = "SelectionList";
public const string MenuKeyTagInput = "TagInput";
public const string MenuKeySkeleton = "Skeleton";
public const string MenuKeyTimeline = "Timeline";
public const string MenuKeyTwoTonePathIcon = "TwoTonePathIcon";
public const string MenuKeyThemeToggler = "ThemeToggler";
public const string MenuKeyToolBar = "ToolBar";

}
Loading

0 comments on commit a88d7f1

Please sign in to comment.