me-web? skeleton: Avalonia 12 app, server, packaging and CI
Build / Desktop, server and tools (push) Successful in 1m7s
Build / Desktop, server and tools (push) Successful in 1m7s
The first screen (online or not, a Check button, every language with a draft notice), the desktop and Android heads, the server's /api/info and /api/ip, a release tool that builds deb, rpm, a Windows exe, macOS zips, a signed APK and the server, and the Gitea workflows that run it. Rules adapted from passolo; AGPL-3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
commit
7589121846
76 files changed
+3082
No files matched your search
@@ -0,0 +1,51 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Headless;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Threading;
|
||||
|
||||
using MeWeb.App;
|
||||
using MeWeb.App.Services;
|
||||
using MeWeb.App.ViewModels;
|
||||
using MeWeb.App.Views;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
var output = args.Length > 0 ? args[0] : Path.Combine("dist", "screenshots");
|
||||
var codes = args.Length > 1 ? args[1].Split(',', StringSplitOptions.RemoveEmptyEntries) : Languages.All.Select(l => l.Code).ToArray();
|
||||
Directory.CreateDirectory(output);
|
||||
|
||||
var session = HeadlessUnitTestSession.StartNew(typeof(ScreenshotEntry));
|
||||
await session.Dispatch(() =>
|
||||
{
|
||||
foreach (var (width, height, label) in new[] { (1100, 760, "desktop"), (400, 820, "phone") })
|
||||
{
|
||||
foreach (var code in codes)
|
||||
{
|
||||
Localizer.Instance.SetLanguage(Languages.Find(code) ?? Languages.Fallback);
|
||||
var model = App.Services.GetRequiredService<MainViewModel>();
|
||||
var window = new Window { Width = width, Height = height, Content = new MainView { DataContext = model } };
|
||||
window.Show();
|
||||
Dispatcher.UIThread.RunJobs();
|
||||
var frame = window.CaptureRenderedFrame();
|
||||
var path = Path.Combine(output, $"main-{label}-{code}.png");
|
||||
if (frame is not null)
|
||||
{
|
||||
using var file = File.Create(path);
|
||||
frame.Save(file, new PngBitmapEncoderOptions());
|
||||
}
|
||||
Console.WriteLine($"{path} {(frame is null ? "no frame" : "ok")}");
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
}, CancellationToken.None);
|
||||
Environment.Exit(0);
|
||||
|
||||
public static class ScreenshotEntry
|
||||
{
|
||||
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<MeWeb.App.App>()
|
||||
.UseSkia()
|
||||
.UseHarfBuzz()
|
||||
.WithInterFont()
|
||||
.UseHeadless(new AvaloniaHeadlessPlatformOptions { UseHeadlessDrawing = false });
|
||||
}
|
||||
Reference in new issue
Block a user