Skip to content
Open
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
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
root = true

[*.cs]
indent_style = space
indent_size = 4
end_of_line = lf
58 changes: 19 additions & 39 deletions .github/workflows/azure-swa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,45 @@ name: Azure Static Web Apps CI/CD
on:
push:
branches:
- release/*
- release/*

jobs:
build_job:
build_and_deploy_job:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- enableThreads: false
folderName: "st"
- enableThreads: true
folderName: "mt"
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
with:
submodules: recursive

- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v6
with:
dotnet-version: 9.0.101
global-json-file: global.json

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

- name: Publish .NET Project
run: dotnet publish Solitaire.Browser/Solitaire.Browser.csproj -c Release -p:WasmEnableThreads=${{matrix.enableThreads}} -o artifacts/${{matrix.folderName}}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.folderName }}
path: artifacts/${{ matrix.folderName }}/wwwroot
- name: Install DotNetCompress
run: dotnet tool install --global DotNetCompress --version 1.0.0-preview.7 --no-cache

deploy_job:
needs: [ build_job ]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish .NET Project
run: dotnet publish Solitaire.Browser/Solitaire.Browser.csproj -c Release -o release --nologo

- name: Arrange folders
run: |
mkdir -p deploy/
mkdir -p deploy/mt
mv artifacts/st/* deploy/
mv artifacts/mt/* deploy/mt/
- name: Brotli Compress Output (dll)
run: DotNetCompress -d Solitaire.Browser/bin/Release/net10.0/browser-wasm/AppBundle/ -p '*.dll' -p '*.js' -p '*.symbols' -p '*.blat' -p '*.bin' -p '*.wasm'

- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APP_DEPLOY_KEY }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
app_location: "deploy"
api_location: ""
output_location: ""
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "Solitaire.Browser/bin/Release/net10.0/browser-wasm/AppBundle/" # App source code path
api_location: "" # Api source code path - optional
output_location: "" # Modify this to where your SSG places the built HTML - could be `dist`, `build`... check your config
skip_app_build: true
###### End of Repository/Build Configurations ######
23 changes: 23 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Quality

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
checks:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
- name: Install WebAssembly workload
run: dotnet workload install wasm-tools
- name: Desktop build
run: dotnet build Solitaire.Desktop/Solitaire.Desktop.csproj -c Release --warnaserror
- name: Browser build
run: dotnet build Solitaire.Browser/Solitaire.Browser.csproj -c Release --warnaserror
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,6 @@ $RECYCLE.BIN/
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Local browser toolchain and package cache
.deps/
14 changes: 11 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<Project>
<PropertyGroup>
<AvaloniaVersion>11.3.2</AvaloniaVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Nullable>enable</Nullable>
<AvaloniaVersion>12.2.999-cibuild0069849-alpha</AvaloniaVersion>
<SkiaSharpVersion>3.119.4</SkiaSharpVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest-recommended</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>
<NuGetAuditLevel>low</NuGetAuditLevel>
</PropertyGroup>
</Project>
</Project>
13 changes: 13 additions & 0 deletions Solitaire.Android/AndroidApp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Android.App;
using Android.Runtime;
using Avalonia.Android;

namespace Solitaire.Android;

[Application]
internal sealed class AndroidApp : AvaloniaAndroidApplication<App>
{
public AndroidApp(nint javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}
}
14 changes: 2 additions & 12 deletions Solitaire.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
using Android.App;
using Android.Content.PM;
using Avalonia;
using Avalonia.Android;

namespace Solitaire.Android;

[Activity(
Label = "Solitaire.Android",
Theme = "@style/MyTheme.NoActionBar",
Icon = "@drawable/icon",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App>
[Activity(Label = "Solitaire.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleInstance, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)]
internal sealed class MainActivity : AvaloniaMainActivity
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder);
}
}
66 changes: 0 additions & 66 deletions Solitaire.Android/Resources/drawable-night-v31/avalonia_anim.xml

This file was deleted.

71 changes: 0 additions & 71 deletions Solitaire.Android/Resources/drawable-v31/avalonia_anim.xml

This file was deleted.

4 changes: 0 additions & 4 deletions Solitaire.Android/Resources/values-night/colors.xml

This file was deleted.

21 changes: 0 additions & 21 deletions Solitaire.Android/Resources/values-v31/styles.xml

This file was deleted.

9 changes: 7 additions & 2 deletions Solitaire.Android/Resources/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
<style name="MyTheme">
</style>

<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
</style>

<style name="MyTheme.Splash" parent ="MyTheme.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowContentOverlay">@null</item>
</style>

</resources>
Loading