Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: 📝 install: model code snippet finished. #22

Merged
merged 6 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
36 changes: 33 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: build
on: [push, pull_request]
jobs:
dotnet-build:
dotnet-build-logic:
if: true
runs-on: windows-latest
steps:
Expand All @@ -14,11 +14,41 @@ jobs:
- name: Build Logic
run: dotnet build "./logic/logic.sln" -c Release

dotnet-build-install:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Build Installer
run: dotnet build "./installer/installer.sln" -c Release
run: dotnet build "./installer/installer.sln" -c Release -f net7.0-windows10.0.19041.0

dotnet-build-launcher:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Build Launcher
run: dotnet build "./launcher/launcher.sln" -c Release


dotnet-build-playback:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Build Playback
run: dotnet build "./playback/playback.sln" -c Release
33 changes: 30 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
exclude: './players'
inplace: False

dotnet-format-checking:
dotnet-format-checking-logic:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,17 +26,44 @@ jobs:
run: |
dotnet restore "./logic/logic.sln"
dotnet format "./logic/logic.sln" --severity error --no-restore --verify-no-changes


dotnet-format-checking-installer:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Check Installer
run: |
dotnet restore "./installer/installer.sln"
dotnet format "./installer/installer.sln" --severity error --no-restore --verify-no-changes


dotnet-format-checking-launcher:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Check Launcher
run: |
dotnet restore "./launcher/launcher.sln"
dotnet format "./launcher/launcher.sln" --severity error --no-restore --verify-no-changes

dotnet-format-checking-playback:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Check Playback
run: |
dotnet restore "./playback/playback.sln"
Expand Down
82 changes: 79 additions & 3 deletions installer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
# .NET
project.lock.json
project.fragment.lock.json
artifacts/

# Tye
.tye/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

Expand Down Expand Up @@ -397,5 +400,78 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml

#THUAI playback file
*.thuaipb
##
## Visual studio for Mac
##


# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/

# Mac bundle stuff
*.dmg
*.app

# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk
14 changes: 14 additions & 0 deletions installer/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:installer"
x:Class="installer.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
12 changes: 12 additions & 0 deletions installer/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace installer
{
public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new AppShell();
}
}
}
31 changes: 31 additions & 0 deletions installer/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="installer.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:installer"
Shell.FlyoutBehavior="Disabled">

<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<Tab Title="首页">
<ShellContent
Title="首页"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />
</Tab>

<ShellContent
Title="比赛"
ContentTemplate="{DataTemplate local:CompetitionPage}"
Route="CompetitionPage" />

<ShellContent
Title="登录"
ContentTemplate="{DataTemplate local:LoginPage}"
Route="LoginPage" />

</FlyoutItem>



</Shell>
10 changes: 10 additions & 0 deletions installer/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace installer
{
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
}
}
}
25 changes: 25 additions & 0 deletions installer/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Microsoft.Extensions.Logging;

namespace installer
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
}
Loading
Loading