Skip to content

Commit c275a74

Browse files
committed
Merge dev
2 parents e535d15 + 3df5b60 commit c275a74

File tree

4 files changed

+102
-12
lines changed

4 files changed

+102
-12
lines changed

.github/workflows/build-core-lib.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ jobs:
4242
- name: Checkout source
4343
uses: actions/checkout@v4
4444

45-
# - name: Setup .NET 8.0
46-
# uses: actions/setup-dotnet@v4
47-
# with:
48-
# dotnet-version: 8.0.x
49-
# dotnet-quality: ga
50-
5145
# - name: Setup .NET 9.0
5246
# uses: actions/setup-dotnet@v4
5347
# with:

.github/workflows/deploy_demo.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
- name: Checkout source
3838
uses: actions/checkout@v4
3939

40-
- name: .NET Setup SDKs
41-
uses: actions/setup-dotnet@v4
42-
with:
43-
dotnet-version: 9.0.205
44-
dotnet-quality: ga
40+
# - name: Setup .NET 9.0
41+
# uses: actions/setup-dotnet@v4
42+
# with:
43+
# dotnet-version: 9.0.205
44+
# dotnet-quality: ga
4545

4646
- name: Setup .NET 10.0
4747
uses: actions/setup-dotnet@v4

.github/workflows/deploy_preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Checkout source
3939
uses: actions/checkout@v4
4040

41-
# - name: .NET Setup SDKs
41+
# - name: Setup .NET 9.0
4242
# uses: actions/setup-dotnet@v4
4343
# with:
4444
# dotnet-version: 9.0.205

_PublishDemoLocally.ps1

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env pwsh
2+
3+
# Ask user for configuration
4+
Write-Host "👉 Configuration setup..." -ForegroundColor Cyan
5+
Write-Host ""
6+
7+
# Ask for .NET version
8+
$dotnetVersionChoice = Read-Host "❓ Which .NET version do you want to use? (9 for net9.0, 10 for net10.0) [default: 9]"
9+
if ($dotnetVersionChoice -eq "" -or $dotnetVersionChoice -eq "9") {
10+
$dotnetVersion = "net9.0"
11+
} elseif ($dotnetVersionChoice -eq "10") {
12+
$dotnetVersion = "net10.0"
13+
} else {
14+
Write-Host "⛔ Invalid choice." -ForegroundColor Red
15+
exit 1
16+
}
17+
18+
# Ask for build number
19+
$buildNumber = Read-Host "❓ What is the BuildNumber version to use? (e.g., 4.13.0)"
20+
if ([string]::IsNullOrWhiteSpace($buildNumber)) {
21+
Write-Host "⛔ Build number cannot be empty." -ForegroundColor Red
22+
exit 1
23+
}
24+
25+
Write-Host ""
26+
Write-Host "Configuration:" -ForegroundColor Green
27+
Write-Host " .NET Version: $dotnetVersion" -ForegroundColor White
28+
Write-Host " Build Number: $buildNumber" -ForegroundColor White
29+
Write-Host ""
30+
31+
# Clean previous build artifacts
32+
Write-Host "👉 Cleaning previous build artifacts (bin and obj)..." -ForegroundColor Yellow
33+
34+
if (Test-Path "./examples/Demo/Client/bin") {
35+
Remove-Item -Path "./examples/Demo/Client/bin" -Recurse -Force
36+
}
37+
38+
if (Test-Path "./examples/Demo/Client/obj") {
39+
Remove-Item -Path "./examples/Demo/Client/obj" -Recurse -Force
40+
}
41+
42+
if (Test-Path "./src/Core/bin/") {
43+
Remove-Item -Path "./src/Core/bin" -Recurse -Force
44+
}
45+
46+
if (Test-Path "./src/Core/obj/") {
47+
Remove-Item -Path "./src/Core/obj" -Recurse -Force
48+
}
49+
50+
if (Test-Path "./src/Extensions/DesignToken.Generator/bin/") {
51+
Remove-Item -Path "./src/Extensions/DesignToken.Generator/bin" -Recurse -Force
52+
}
53+
54+
if (Test-Path "./src/Extensions/DesignToken.Generator/obj/") {
55+
Remove-Item -Path "./src/Extensions/DesignToken.Generator/obj" -Recurse -Force
56+
}
57+
58+
# Publish the demo
59+
Write-Host "👉 Publishing demo..." -ForegroundColor Yellow
60+
dotnet publish "./examples/Demo/Client/FluentUI.Demo.Client.csproj" -c Release -o "./examples/Demo/Client/bin/Publish" -f $dotnetVersion -r linux-x64 --self-contained=true -p:BuildNumber=$buildNumber
61+
62+
# Verify that the bundle JS file has the expected size
63+
Write-Host "👉 Verifying bundle JS file size..." -ForegroundColor Yellow
64+
$bundleFilePath = "./examples/Demo/Client/bin/Publish/wwwroot/_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js.br"
65+
66+
if (Test-Path $bundleFilePath) {
67+
$fileSize = (Get-Item $bundleFilePath).Length
68+
$fileSizeKB = [math]::Round($fileSize / 1024, 2)
69+
70+
if ($fileSize -gt 1024) {
71+
Write-Host "☑️ Bundle JS file verified: $fileSizeKB KB" -ForegroundColor Green
72+
} else {
73+
Write-Host "⛔ Bundle JS file is too small: $fileSizeKB KB (expected > 1KB)" -ForegroundColor Red
74+
Write-Host "⛔ This may indicate a build issue with the JS bundle generation." -ForegroundColor Red
75+
Write-Host "⛔ Install .NET 9.0.205 SDK, remove the references to 'net10' and add a `global.json` file with `{ ""sdk"": { ""version"": ""9.0.205"" } }`." -ForegroundColor Red
76+
exit 1
77+
}
78+
} else {
79+
Write-Host "⛔ Bundle JS file not found: $bundleFilePath" -ForegroundColor Red
80+
Write-Host "⛔ This may indicate a build issue with the JS bundle generation." -ForegroundColor Red
81+
exit 1
82+
}
83+
84+
Write-Host "✅ Demo publish process completed successfully!" -ForegroundColor Green
85+
86+
Write-Host "👉 You can deploy to Azure using a command like:" -ForegroundColor Green
87+
Write-Host "▶️ swa deploy --output-location ./examples/Demo/Client/bin/Publish/wwwroot --env production --deployment-token <TOKEN>" -ForegroundColor Green
88+
89+
# Ask user if they want to run the website
90+
# Require 'dotnet tool install --global dotnet-serve'
91+
Write-Host ""
92+
$runWebsite = Read-Host "Do you want to run the local website now? (Y/n) ... using `dotnet serve` "
93+
if ($runWebsite -eq "" -or $runWebsite -eq "Y" -or $runWebsite -eq "y") {
94+
Write-Host "👉 Starting the website..." -ForegroundColor Green
95+
dotnet serve --directory "./examples/Demo/Client/bin/Publish/wwwroot" --brotli --gzip --open-browser
96+
}

0 commit comments

Comments
 (0)