feat: ready for 11.1.0.

This commit is contained in:
Zhang Dian
2024-07-03 23:39:17 +08:00
parent 678bcdef9c
commit b487dc9307
14 changed files with 70 additions and 41 deletions

View File

@@ -2,12 +2,12 @@ name: Deploy to GitHub Pages
env: env:
PROJECT_PATH: demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj 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: on:
push: push:
branches: [ "deploy" ] branches: [ "action/deploy" ]
pull_request: pull_request:
branches: [ "deploy" ] branches: [ "action/deploy" ]
jobs: jobs:
deploy-to-github-pages: deploy-to-github-pages:
@@ -16,19 +16,16 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.1.1 uses: actions/checkout@v4.1.1
- name: Setup .NET 7 - name: Setup .NET 8
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 7.0.405 dotnet-version: 8.0.x
- name: Install wasm-tools - name: Install wasm-tools
run: dotnet workload install wasm-tools wasm-tools-net7 run: dotnet workload install wasm-tools
- name: Install DotNetCompress
run: dotnet tool install --global DotNetCompress --version 3.0.0 --no-cache
- name: Publish .NET Project - 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 - name: Change base-tag in index.html
run: sed -i 's/<base href="\/" \/>/<base href="\/Ursa.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html run: sed -i 's/<base href="\/" \/>/<base href="\/Ursa.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html
@@ -36,12 +33,6 @@ jobs:
- name: copy index.html to 404.html - name: copy index.html to 404.html
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/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 - name: Add .nojekyll file
run: touch $OUTPUT_PATH/.nojekyll run: touch $OUTPUT_PATH/.nojekyll

49
.github/workflows/pack.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Pack
on:
push:
branches: [ "action/pack" ]
pull_request:
branches: [ "action/pack" ]
jobs:
nuget_desktop:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Nuget
run: dotnet pack ./src/Ursa -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/upload-artifact@v4.3.1
with:
name: nuget_desktop
path: |
./nugets
./**/publish/*.exe
android:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- 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/upload-artifact@v4.3.1
with:
name: android
path: ./**/publish/*Signed.apk

View File

@@ -1,6 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AvaloniaVersion>11.0.10</AvaloniaVersion> <AvaloniaVersion>11.1.0-rc2</AvaloniaVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -1,15 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk.WebAssembly">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net8.0-browser</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<WasmExtraFilesToDeploy Include="AppBundle\**"/>
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/> <PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)"/>
</ItemGroup> </ItemGroup>

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 169 KiB

View File

@@ -7,8 +7,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="/" /> <base href="/" />
<link rel="modulepreload" href="./main.js" /> <link rel="modulepreload" href="./main.js" />
<link rel="modulepreload" href="./dotnet.js" /> <link rel="modulepreload" href="./_framework/dotnet.js" />
<link rel="modulepreload" href="./avalonia.js" /> <link rel="modulepreload" href="./_framework/avalonia.js" />
<link rel="stylesheet" href="./app.css" /> <link rel="stylesheet" href="./app.css" />
</head> </head>

View File

@@ -1,4 +1,4 @@
import { dotnet } from './dotnet.js' import { dotnet } from './_framework/dotnet.js'
const is_browser = typeof window != "undefined"; const is_browser = typeof window != "undefined";
if (!is_browser) throw new Error(`Expected to be running in a browser`); if (!is_browser) throw new Error(`Expected to be running in a browser`);
@@ -10,4 +10,4 @@ const dotnetRuntime = await dotnet
const config = dotnetRuntime.getConfig(); const config = dotnetRuntime.getConfig();
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]); await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]);

View File

@@ -19,7 +19,7 @@
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageReference Include="Semi.Avalonia" Version="11.0.7" /> <PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -36,7 +36,7 @@ public class MenuViewModel: ViewModelBase
new() { MenuHeader = "Message Box", Key = MenuKeys.MenuKeyMessageBox }, new() { MenuHeader = "Message Box", Key = MenuKeys.MenuKeyMessageBox },
new() { MenuHeader = "MultiComboBox", Key = MenuKeys.MenuKeyMultiComboBox, Status = "Updated" }, new() { MenuHeader = "MultiComboBox", Key = MenuKeys.MenuKeyMultiComboBox, Status = "Updated" },
new() { MenuHeader = "Nav Menu", Key = MenuKeys.MenuKeyNavMenu }, new() { MenuHeader = "Nav Menu", Key = MenuKeys.MenuKeyNavMenu },
// new() { MenuHeader = "Number Displayer", Key = MenuKeys.MenuKeyNumberDisplayer, Status = "New" }, new() { MenuHeader = "Number Displayer", Key = MenuKeys.MenuKeyNumberDisplayer, Status = "New" },
new() { MenuHeader = "Numeric UpDown", Key = MenuKeys.MenuKeyNumericUpDown }, new() { MenuHeader = "Numeric UpDown", Key = MenuKeys.MenuKeyNumericUpDown },
new() { MenuHeader = "NumPad", Key = MenuKeys.MenuKeyNumPad }, new() { MenuHeader = "NumPad", Key = MenuKeys.MenuKeyNumPad },
new() { MenuHeader = "Pagination", Key = MenuKeys.MenuKeyPagination }, new() { MenuHeader = "Pagination", Key = MenuKeys.MenuKeyPagination },

View File

@@ -1,5 +1,5 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<AvaloniaVersion>11.0.0</AvaloniaVersion> <AvaloniaVersion>11.1.0-rc2</AvaloniaVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -71,10 +71,10 @@
MaxHeight="300" MaxHeight="300"
HorizontalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">
<TextBlock <ContentPresenter
Name="PART_ContentPresenter" Name="PART_ContentPresenter"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{TemplateBinding Content}" Content="{TemplateBinding Content}"
TextAlignment="Left" TextAlignment="Left"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</ScrollViewer> </ScrollViewer>
@@ -203,10 +203,10 @@
MaxHeight="300" MaxHeight="300"
HorizontalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">
<TextBlock <ContentPresenter
Name="PART_ContentPresenter" Name="PART_ContentPresenter"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{TemplateBinding Content}" Content="{TemplateBinding Content}"
TextAlignment="Left" TextAlignment="Left"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</ScrollViewer> </ScrollViewer>

View File

@@ -23,9 +23,4 @@
<ItemGroup> <ItemGroup>
<None Include="irihi.png" Pack="true" PackagePath=""/> <None Include="irihi.png" Pack="true" PackagePath=""/>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Controls\Panels\" />
</ItemGroup>
</Project> </Project>