4 Commits

5 changed files with 63 additions and 43 deletions

View File

@@ -8,59 +8,61 @@ on:
paths: paths:
- 'Moonlight.*/*.csproj' - 'Moonlight.*/*.csproj'
env:
NUGET_SOURCE: https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json
NUGET_PUBLIC: https://api.nuget.org/v3/index.json
CONFIGURATION: Debug
jobs: jobs:
publish: publish:
name: Publish Dev Packages name: Publish ${{ matrix.project }}
runs-on: linux_amd64 runs-on: linux_amd64
strategy:
matrix:
project:
- Moonlight.Api
- Moonlight.Shared
- Moonlight.Frontend
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Publish api server - name: Restore NuGet packages
- name: Build project run: >
run: dotnet build Moonlight.Api --configuration Debug dotnet restore ${{ matrix.project }}
--source ${{ env.NUGET_PUBLIC }}
--source ${{ env.NUGET_SOURCE }}
- name: Publish NuGet package # Frontend requires a host build + Tailwind compilation first
run: dotnet pack Moonlight.Api --configuration Debug --output ./artifacts - name: Build frontend host (Frontend only)
if: matrix.project == 'Moonlight.Frontend'
run: >
dotnet build Hosts/Moonlight.Frontend.Host
--configuration ${{ env.CONFIGURATION }}
- name: Push nuget package - name: Build Tailwind styles (Frontend only)
run: dotnet nuget push ./artifacts/*.nupkg --skip-duplicate --source https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json --api-key ${{ secrets.ACCESS_TOKEN }} if: matrix.project == 'Moonlight.Frontend'
- name: Remove artifacts
run: rm -rf ./artifacts
# Publish frontend
# We need to build it first so the class list files generate
- name: Build project
run: dotnet build Hosts/Moonlight.Frontend.Host --configuration Debug
- name: Build tailwind styles and extract class list
working-directory: Hosts/Moonlight.Frontend.Host/Styles working-directory: Hosts/Moonlight.Frontend.Host/Styles
run: npm install && npm run build run: npm install && npm run build
- name: Build project - name: Build project
run: dotnet build Moonlight.Frontend --configuration Debug run: >
dotnet build ${{ matrix.project }}
--configuration ${{ env.CONFIGURATION }}
--no-restore
- name: Publish NuGet package - name: Pack NuGet package
run: dotnet pack Moonlight.Frontend --configuration Debug --output ./artifacts run: >
dotnet pack ${{ matrix.project }}
--configuration ${{ env.CONFIGURATION }}
--output ./artifacts
--no-build
- name: Push nuget package - name: Push NuGet package
run: dotnet nuget push ./artifacts/*.nupkg --skip-duplicate --source https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json --api-key ${{ secrets.ACCESS_TOKEN }} run: >
dotnet nuget push ./artifacts/*.nupkg
- name: Remove artifacts --skip-duplicate
run: rm -rf ./artifacts --source ${{ env.NUGET_SOURCE }}
--api-key ${{ secrets.ACCESS_TOKEN }}
# Publish shared
- name: Build project
run: dotnet build Moonlight.Shared --configuration Debug
- name: Publish NuGet package
run: dotnet pack Moonlight.Shared --configuration Debug --output ./artifacts
- name: Push nuget package
run: dotnet nuget push ./artifacts/*.nupkg --skip-duplicate --source https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json --api-key ${{ secrets.ACCESS_TOKEN }}
- name: Remove artifacts
run: rm -rf ./artifacts

View File

@@ -6,6 +6,7 @@
@import "./theme.css"; @import "./theme.css";
@source "../bin/ShadcnBlazor/ShadcnBlazor.map"; @source "../bin/ShadcnBlazor/ShadcnBlazor.map";
@source "../bin/**/*.map";
@source "../../../Moonlight.Api/**/*.razor"; @source "../../../Moonlight.Api/**/*.razor";
@source "../../../Moonlight.Api/**/*.cs"; @source "../../../Moonlight.Api/**/*.cs";

View File

@@ -102,6 +102,9 @@
<script defer src="/_content/ShadcnBlazor/interop.js"></script> <script defer src="/_content/ShadcnBlazor/interop.js"></script>
<script defer src="/_content/ShadcnBlazor.Extras/interop.js"></script> <script defer src="/_content/ShadcnBlazor.Extras/interop.js"></script>
<script defer src="/_content/ShadcnBlazor.Extras/codemirror-bundle.js"></script> <script defer src="/_content/ShadcnBlazor.Extras/codemirror-bundle.js"></script>
<script src="/_content/Moonlight.Frontend/chart.umd.js" defer></script>
<script src="_framework/blazor.webassembly#[.{fingerprint}].js"></script> <script src="_framework/blazor.webassembly#[.{fingerprint}].js"></script>
</body> </body>

View File

@@ -34,7 +34,7 @@
@if (SettingsResult.Succeeded) @if (SettingsResult.Succeeded)
{ {
<TabsContent Value="settings"> <TabsContent Value="settings">
<<Moonlight.Frontend.Admin.Sys.Settings.Index/> <Moonlight.Frontend.Admin.Sys.Settings.Index/>
</TabsContent> </TabsContent>
} }
@if (DiagnoseResult.Succeeded) @if (DiagnoseResult.Succeeded)

File diff suppressed because one or more lines are too long