Skip to content

Commit

Permalink
Added standalone and publish for it
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Dec 11, 2024
1 parent 7b849c4 commit 7a40828
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 22 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish-standalone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Standalone

on:
push:
branches: [ v15 ]
workflow_dispatch:

env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
publish-standalone:
name: Publish Standalone ${{ matrix.rid }}
matrix:
data:
[
{ rid: 'win-x64', os: 'windows-latest' },
{ rid: 'win-x86', os: 'windows-latest' },
{ rid: 'linux-x64', os: 'ubuntu-latest' },
{ rid: 'osx-x64', os: 'macos-13' },
{ rid: 'osx-arm64', os: 'macos-latest' }
]
runs-on: ${{ matrix.data.os }}
steps:
- name: Setup
uses: butr/actions-common-setup@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x.x

- name: Run _build
run: >-
dotnet publish src/BUTR.CrashReport.Renderer.ImGui.Standalone/BUTR.CrashReport.Renderer.ImGui.Standalone.csproj --configuration Release -r "${{ matrix.data.rid }}" -o "./pub";
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.data.rid }}
path: "./pub"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0;net6.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ namespace BUTR.CrashReport.Renderer.Html.Extensions;

internal static class EnumExtensions
{
public static IEnumerable<TEnum> GetFlags<TEnum>(this TEnum input) where TEnum : Enum =>
public static IEnumerable<TEnum> GetFlags<TEnum>(this TEnum input) where TEnum : struct, Enum =>
#if NET6_0_OR_GREATER
Enum.GetValues<TEnum>().Where(@enum => input.HasFlag(@enum));
#else
Enum.GetValues(input.GetType()).OfType<TEnum>().Where(@enum => input.HasFlag(@enum));
#endif
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<InvariantGlobalization>true</InvariantGlobalization>
<InvariantTimezone>true</InvariantTimezone>
<OptimizationPreference>Size</OptimizationPreference>

<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<EnableAggressiveTrimming>true</EnableAggressiveTrimming>

<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>

<!--
-->

<!-- 8MB .exe with native .dll -->
<PublishAot>true</PublishAot>

<!-- 14MB .exe -->
<!--
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<PublishReadyToRun>false</PublishReadyToRun>
-->
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BUTR.CrashReport.Renderer.Html\BUTR.CrashReport.Renderer.Html.csproj" />
<ProjectReference Include="..\BUTR.CrashReport.Renderer.Zip\BUTR.CrashReport.Renderer.Zip.csproj" />
<ProjectReference Include="..\BUTR.CrashReport.Renderer.ImGui.Silk.NET\BUTR.CrashReport.Renderer.ImGui.Silk.NET.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.71" />
<PackageReference Include="TextCopy" Version="6.2.1" />

<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.0" />
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
<PackageReference Include="System.Buffers" Version="4.6.0" />
<PackageReference Include="System.Memory" Version="4.6.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.6.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NativeFileDialogSharp" Version="0.6.0-alpha" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\BUTR.CrashReport.Renderer.ImGui.Tool\**\*.cs"
Exclude="..\BUTR.CrashReport.Renderer.ImGui.Tool\obj\**\*.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@

<InvariantGlobalization>true</InvariantGlobalization>

<!--
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
-->

<!-- 8MB .exe with native .dll -->
<!--
<PublishAot>true</PublishAot>
-->

<!-- 14MB .exe -->
<!--
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<PublishReadyToRun>false</PublishReadyToRun>
-->

<ToolCommandName>butr_crashreport_imgui</ToolCommandName>
<IsTool>true</IsTool>
<PackAsTool>true</PackAsTool>
Expand Down

0 comments on commit 7a40828

Please sign in to comment.