Skip to content

Commit

Permalink
Convert app to class library for distribution via nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptoc1 committed Apr 27, 2024
1 parent 2eff750 commit 3e6df88
Show file tree
Hide file tree
Showing 40 changed files with 720 additions and 196 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ jobs:
run: dotnet restore --locked-mode

- name: pack
run: dotnet pack src/Launcher/CS2Launcher.AspNetCore.Launcher.csproj -c Release -o .package --no-restore
run: dotnet pack -c Release -o .packages --no-restore

- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: cs2-launcher
path: .package
name: cs2-launcher-packages
path: .packages

publish:
needs: [pack]
Expand All @@ -83,7 +83,7 @@ jobs:
- name: download artifact
uses: actions/download-artifact@v4
with:
name: cs2-launcher
name: cs2-launcher-packages

- name: push
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
10 changes: 5 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"name": "Debug Sample (Core)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/sample/bin/Debug/net8.0/CS2Launcher.Sample.dll",
"program": "${workspaceFolder}/sample/Launcher/bin/Debug/net8.0/CS2Launcher.Sample.Launcher.dll",
"args": [
"environment=Development"
],
"env": {
"DOTNET_ENVIRONMENT": "Development"
},
"cwd": "${workspaceFolder}/sample",
"cwd": "${workspaceFolder}/sample/Launcher",
"justMyCode": true,
"preLaunchTask": "${defaultBuildTask}",
"requireExactSource": true,
Expand All @@ -36,7 +36,7 @@
"type": "blazorwasm",
"request": "launch",
"browser": "chrome",
"cwd": "${workspaceFolder}/sample",
"cwd": "${workspaceFolder}/sample/Launcher",
"dotNetConfig": {
"justMyCode": true,
"logging": {
Expand All @@ -63,14 +63,14 @@
},
"hosted": true,
"preLaunchTask": "${defaultBuildTask}",
"program": "${workspaceFolder}/sample/bin/Debug/net8.0/CS2Launcher.Sample.dll",
"program": "${workspaceFolder}/sample/Launcher/bin/Debug/net8.0/CS2Launcher.Sample.Launcher.dll",
"serverReadyAction": {
"action": "debugWithChrome",
"killOnServerStop": true,
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
},
"url": "https://localhost:52750",
"webRoot": "${workspaceFolder}/sample",
"webRoot": "${workspaceFolder}/sample/Launcher",
}
]
}
26 changes: 20 additions & 6 deletions cs2-launcher.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5222FED7-6FE1-46CA-AA88-EA10FA14075C}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CS2Launcher.AspNetCore.Launcher", "src\Launcher\CS2Launcher.AspNetCore.Launcher.csproj", "{115173BC-C8AD-4266-8759-3CA0A14374C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CS2Launcher.Sample", "sample\CS2Launcher.Sample.csproj", "{2ECAA280-96DA-4212-9857-6E3BAA4E2217}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CS2Launcher.AspNetCore.App", "src\App\CS2Launcher.AspNetCore.App.csproj", "{42BE4AA8-0386-474D-BFE2-0F4E68476B42}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{170E8297-96FC-4172-B45C-2FCBCEFB9F4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CS2Launcher.Sample.Launcher", "sample\Launcher\CS2Launcher.Sample.Launcher.csproj", "{A415B696-7249-4A76-8423-6AC7163C8347}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CS2Launcher.Sample.App", "sample\App\CS2Launcher.Sample.App.csproj", "{55CFF728-1CC8-45A8-A4A8-1FC690065E3E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -21,21 +29,27 @@ Global
{115173BC-C8AD-4266-8759-3CA0A14374C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{115173BC-C8AD-4266-8759-3CA0A14374C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{115173BC-C8AD-4266-8759-3CA0A14374C2}.Release|Any CPU.Build.0 = Release|Any CPU
{2ECAA280-96DA-4212-9857-6E3BAA4E2217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2ECAA280-96DA-4212-9857-6E3BAA4E2217}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ECAA280-96DA-4212-9857-6E3BAA4E2217}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ECAA280-96DA-4212-9857-6E3BAA4E2217}.Release|Any CPU.Build.0 = Release|Any CPU
{42BE4AA8-0386-474D-BFE2-0F4E68476B42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42BE4AA8-0386-474D-BFE2-0F4E68476B42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42BE4AA8-0386-474D-BFE2-0F4E68476B42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42BE4AA8-0386-474D-BFE2-0F4E68476B42}.Release|Any CPU.Build.0 = Release|Any CPU
{A415B696-7249-4A76-8423-6AC7163C8347}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A415B696-7249-4A76-8423-6AC7163C8347}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A415B696-7249-4A76-8423-6AC7163C8347}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A415B696-7249-4A76-8423-6AC7163C8347}.Release|Any CPU.Build.0 = Release|Any CPU
{55CFF728-1CC8-45A8-A4A8-1FC690065E3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55CFF728-1CC8-45A8-A4A8-1FC690065E3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55CFF728-1CC8-45A8-A4A8-1FC690065E3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55CFF728-1CC8-45A8-A4A8-1FC690065E3E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{115173BC-C8AD-4266-8759-3CA0A14374C2} = {5222FED7-6FE1-46CA-AA88-EA10FA14075C}
{42BE4AA8-0386-474D-BFE2-0F4E68476B42} = {5222FED7-6FE1-46CA-AA88-EA10FA14075C}
{A415B696-7249-4A76-8423-6AC7163C8347} = {170E8297-96FC-4172-B45C-2FCBCEFB9F4D}
{55CFF728-1CC8-45A8-A4A8-1FC690065E3E} = {170E8297-96FC-4172-B45C-2FCBCEFB9F4D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {56EB9027-8ADE-4B88-BDE0-E9BC3DD1ACF4}
Expand Down
5 changes: 5 additions & 0 deletions sample/App/AppRoot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using CS2Launcher.AspNetCore.App;

namespace CS2Launcher.Sample.App;

public sealed class AppRoot : RootComponent;
8 changes: 8 additions & 0 deletions sample/App/CS2Launcher.Sample.App.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Import Project="..\..\src\App\build\CS2Launcher.AspNetCore.App.props" />

<ItemGroup>
<ProjectReference Include="..\..\src\App\CS2Launcher.AspNetCore.App.csproj" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions sample/App/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using CS2Launcher.AspNetCore.App.Hosting;
using CS2Launcher.Sample.App;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

var builder = WebAssemblyHostBuilder.CreateDefault( args );
builder.UseCS2Launcher<AppRoot>();

await using var app = builder.Build();
await app.RunAsync();
Loading

0 comments on commit 3e6df88

Please sign in to comment.