Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Noxalus committed Jul 6, 2024
2 parents f1a7bdc + 5624f43 commit 0956d2d
Show file tree
Hide file tree
Showing 14 changed files with 1,093 additions and 905 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: GitHub Release
on:
push:
branches: [ ci ]
branches: [ ci, avalonia ]
tags:
- 'v*.*'
jobs:
Expand All @@ -24,22 +24,32 @@ jobs:
with:
proj-path: KHFM-VF-Patch/KHFM-VF-Patch.csproj

- name: Build Binary
- name: Build for Windows (x86)
shell: cmd
run: call .\CI\Build.cmd
run: dotnet publish KHFM-VF-Patch/KHFM-VF-Patch.sln /p:PublishReadyToRun=true --self-contained --runtime win-x86

- name: Create Artifact
- name: Build for Linux (x64)
shell: cmd
run: dotnet publish KHFM-VF-Patch/KHFM-VF-Patch.sln /p:PublishReadyToRun=true --self-contained --runtime linux-x64

- name: Create Artifacts
shell: cmd
run: call .\CI\CreateArtifact.cmd

- name: Rename Artifact with project version
- name: Rename Windows Artifact with project version
shell: cmd
run: mv ./KHFM-VF-Patch/KHFM-VF-Patch-Windows.zip ./KHFM-VF-Patch/KHFM-VF-Patch-Windows-${{ steps.get-version.outputs.version }}.zip

- name: Rename Linux Artifact with project version
shell: cmd
run: mv ./KHFM-VF-Patch/KHFM-VF-Patch.zip ./KHFM-VF-Patch/KHFM-VF-Patch-${{ steps.get-version.outputs.version }}.zip
run: mv ./KHFM-VF-Patch/KHFM-VF-Patch-Linux.zip ./KHFM-VF-Patch/KHFM-VF-Patch-Linux-${{ steps.get-version.outputs.version }}.zip

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
files: ./KHFM-VF-Patch/KHFM-VF-Patch-${{ steps.get-version.outputs.version }}.zip
files: |
./KHFM-VF-Patch/KHFM-VF-Patch-Windows-${{ steps.get-version.outputs.version }}.zip
./KHFM-VF-Patch/KHFM-VF-Patch-Linux-${{ steps.get-version.outputs.version }}.zip
draft: true
prerelease: true
31 changes: 22 additions & 9 deletions CI/CreateArtifact.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@
pushd "%~dp0"
cd ..\KHFM-VF-Patch

@REM Create Patches directory
powershell New-Item -Path "bin\x86\Release\net8.0-windows7.0\Resources\Patches" -ItemType Directory
@REM Create Patches directory that will be copy in the artifacts
powershell New-Item -Path "Patches" -ItemType Directory

@REM Zip all sub-patches in the proper directory with the proper extension
powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-EN" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Magic-EN.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-FR" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Magic-FR.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Stranger" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Stranger.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Textures" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Textures.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Voices" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Voices.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Videos" -ArchiveFileName "bin\x86\Release\net8.0-windows7.0\Resources\Patches\KH1FM-Videos.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-EN" -ArchiveFileName "Patches\KH1FM-Magic-EN.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Magic-FR" -ArchiveFileName "Patches\KH1FM-Magic-FR.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Stranger" -ArchiveFileName "Patches\KH1FM-Stranger.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Textures" -ArchiveFileName "Patches\KH1FM-Textures.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Voices" -ArchiveFileName "Patches\KH1FM-Voices.patch" -Format Zip
powershell Compress-7Zip "Resources\Patches\KH1FM-Videos" -ArchiveFileName "Patches\KH1FM-Videos.patch" -Format Zip

@REM ** Windows Platform **

@REM Copy Patches directory
powershell Copy-Item -Path "Patches" -Destination "bin\Release\net8.0\win-x86\publish\Resources" -Recurse

@REM Zip all patch files to upload them for release
powershell Compress-7Zip "bin\Release\net8.0\win-x86\publish" -ArchiveFileName "KHFM-VF-Patch-Windows.zip" -Format Zip

@REM ** Linux Platform **

@REM Copy Patches directory
powershell Copy-Item -Path "Patches" -Destination "bin\Release\net8.0\linux-x64\publish\Resources" -Recurse

@REM Zip all patch files to upload them for release
powershell Compress-7Zip "bin\x86\Release\net8.0-windows7.0" -ArchiveFileName "KHFM-VF-Patch.zip" -Format Zip
powershell Compress-7Zip "bin\Release\net8.0\linux-x64\publish" -ArchiveFileName "KHFM-VF-Patch-Linux.zip" -Format Zip

:exit
popd
Expand Down
9 changes: 9 additions & 0 deletions KHFM-VF-Patch/App.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="KHFM_VF_Patch.App"
RequestedThemeVariant="Light">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>
23 changes: 23 additions & 0 deletions KHFM-VF-Patch/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;

namespace KHFM_VF_Patch;

public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}

public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
}

base.OnFrameworkInitializationCompleted();
}
}
9 changes: 0 additions & 9 deletions KHFM-VF-Patch/App.xaml

This file was deleted.

17 changes: 0 additions & 17 deletions KHFM-VF-Patch/App.xaml.cs

This file was deleted.

10 changes: 0 additions & 10 deletions KHFM-VF-Patch/AssemblyInfo.cs

This file was deleted.

60 changes: 39 additions & 21 deletions KHFM-VF-Patch/KHFM-VF-Patch.csproj
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<RootNamespace>KHFM_VF_Patch</RootNamespace>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>icon.ico</ApplicationIcon>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>Noxalus.pfx</AssemblyOriginatorKeyFile>
<Description>Patch pour changer les voix anglaises de Kingdom Hearts 1 Final Mix PC par les voix française de la version PS2 de 2002.</Description>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Description>Patch pour changer les voix anglaises de Kingdom Hearts 1 Final Mix PC par les voix françaises de la version PS2 de 2002.</Description>
<Copyright>Noxalus</Copyright>
<PackageProjectUrl>https://noxalus.io</PackageProjectUrl>
<PackageIcon>logo.png</PackageIcon>
<RepositoryUrl>https://github.com/Noxalus/KHFM-VF-Patch</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<AssemblyVersion>1.2.2.0</AssemblyVersion>
<FileVersion>1.2.2.0</FileVersion>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.3.0</Version>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Version>2.0.0</Version>
<ApplicationIcon>icon.ico</ApplicationIcon>
<PublishSingleFile>true</PublishSingleFile> <!-- Enable single-file publish -->
<SelfContained>true</SelfContained> <!-- Include the .NET runtime -->
<PublishTrimmed>false</PublishTrimmed> <!-- Disable trimming to avoid issues -->
<!--Avalonia doesen't support TrimMode=link currently,but we are working on that https://github.com/AvaloniaUI/Avalonia/issues/6892 -->
<TrimMode>copyused</TrimMode>
</PropertyGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Images\donate.png" />
<None Remove="Resources\Images\logo.png" />
<None Remove="Resources\Images\MagicPatch.png" />
<None Remove="Resources\Images\TexturePatch.png" />
<None Remove="Resources\logo.png" />
<None Remove="Resources\donate.png" />
<!--This helps with theme dll-s trimming.
If you will publish your application in self-contained mode with p:PublishTrimmed=true and it will use Fluent theme Default theme will be trimmed from the output and vice versa.
https://github.com/AvaloniaUI/Avalonia/issues/5593 -->
<TrimmableAssembly Include="Avalonia.Themes.Fluent" />
<TrimmableAssembly Include="Avalonia.Themes.Default" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNetZip" Version="1.15.0" />
<PackageReference Include="Avalonia" Version="11.0.11" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.11" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.11" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.11" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.11" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.11" />
<PackageReference Include="DotNetZip" Version="1.16.0" />
<PackageReference Include="Xe.BinaryMapper" Version="1.5.2" />
</ItemGroup>

<ItemGroup>
<AvaloniaResource Include="Resources\Images\**" />
<AvaloniaResource Include="icon.png" />
<None Remove=".gitignore" />
</ItemGroup>

<ItemGroup>
<Resource Include="Resources\Images\donate.png">
Expand All @@ -51,6 +67,9 @@
</ItemGroup>

<ItemGroup>
<None Update="icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="patch\KH1FM-VF.patch">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -82,5 +101,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit 0956d2d

Please sign in to comment.