Skip to content

Commit 7a3ff0c

Browse files
committed
fix(fggg): ggg
1 parent 24de67a commit 7a3ff0c

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

.github/workflows/dev.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,20 @@ jobs:
316316
# /p:INDEPENDENT_CLIENT_GH_PAGES=true \
317317
# env:
318318
# INDEPENDENT_CLIENT_GH_PAGES: true
319+
320+
# Hardcode the INDEPENDENT_CLIENT_GH_PAGES value
321+
- name: Modify appsettings.json with hardcoded value
322+
run: |
323+
jq '.INDEPENDENT_CLIENT_GH_PAGES = "true"' appsettings.json > tmp.json && mv tmp.json appsettings.json
324+
325+
# List files in the root to ensure appsettings.json exists
326+
- name: List files
327+
run: ls -la
328+
329+
# Print the contents of appsettings.json to verify the value
330+
- name: Display appsettings.json content
331+
run: cat appsettings.json
332+
319333
- name: Publish client using client release .csproj logic
320334
run: |
321335
dotnet publish ./TestHostPrerenderWASM/TestHostPrerenderWASM.Client/TestHostPrerenderWASM.Client.csproj --configuration Release \
@@ -452,7 +466,7 @@ jobs:
452466
# # echo "Restoring NuGet packages..."
453467
# # dotnet restore GitPageBlazorWASM.sln
454468

455-
# #qqqqq
469+
#
456470
# # fails because clieant as id expect if release
457471
# # also fails becuase running at the solution level it does not respect the condition on not using the project reference
458472

PackageSettings.props

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<!-- Define the output path where the package will be stored -->
5-
<!--<NupkgOutputPath>$(LocalPackagePath)</NupkgOutputPath>
5+
6+
<!-- being set in csproj directly in cicd at the moment -->
7+
<NupkgOutputPath>$(LocalPackagePath)</NupkgOutputPath>
68

79

810
<UseBCLProjectReference Condition="'$(UseBCLProjectReference)' == '' ">false</UseBCLProjectReference>
@@ -13,7 +15,7 @@
1315

1416
<BCLVersion>$(BCLVersion)</BCLVersion>
1517

16-
<DisablePackageGeneration >$(DisablePackageGeneration)</DisablePackageGeneration>-->
18+
<DisablePackageGeneration >$(DisablePackageGeneration)</DisablePackageGeneration>
1719

1820
</PropertyGroup>
1921

PackageSettings.props.local

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<NupkgOutputPath>C:\LocalDevelopmentPackageVersions</NupkgOutputPath>
77
<GhPageRelease>false</GhPageRelease>
88
<UseBCLProjectReference>false</UseBCLProjectReference>
9-
<!--qqqqqq come back to why did i stop using local env variable after git tags may want to rename this bclversionlocal and automate it with build number, and put a shared file so other solutions can use it like lh with now version updates in development-->
109
<BCLVersion>10.9.7</BCLVersion>
11-
<DisablePackageGeneration>false</DisablePackageGeneration>
10+
<DisablePackageGeneration>false</DisablePackageGeneration>
1211
</PropertyGroup>
1312
</Project>

TestHostPrerenderWASM/TestHostPrerenderWASM.Client/Program.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.AspNetCore.Components.Web;
22
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
33
using Microsoft.Extensions.DependencyInjection;
4+
using Microsoft.JSInterop;
45
using TestHostPrerenderWASM.Client;
56

67
var builder = WebAssemblyHostBuilder.CreateDefault(args);
@@ -10,8 +11,20 @@
1011
//Console.WriteLine($"INDEPENDENT_CLIENT_GH_PAGES value: '{Environment.GetEnvironmentVariable("INDEPENDENT_CLIENT_GH_PAGES", EnvironmentVariableTarget.Process)}'");
1112

1213
//if (Environment.GetEnvironmentVariable("INDEPENDENT_CLIENT_GH_PAGES", EnvironmentVariableTarget.Process) != null)
13-
if (builder.HostEnvironment.IsProduction())
14-
{
14+
15+
16+
// Access configuration value from appsettings.json
17+
var independentClientGhPages = builder.Configuration["INDEPENDENT_CLIENT_GH_PAGES"];
18+
Console.WriteLine($"INDEPENDENT_CLIENT_GH_PAGES value: {independentClientGhPages}");
19+
20+
21+
22+
// Use the value in your app logic
23+
if (independentClientGhPages == "true") {
24+
25+
26+
//if (builder.HostEnvironment.IsProduction())
27+
//{
1528
//Console.WriteLine("Condition is TRUE - Adding root components");
1629
builder.RootComponents.Add<App>("#app");
1730
builder.RootComponents.Add<HeadOutlet>("head::after");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*",
9+
"INDEPENDENT_CLIENT_GH_PAGES": "false"
10+
}

0 commit comments

Comments
 (0)