Skip to content

Commit 2963d4e

Browse files
committed
fix(cicd): PrepareForBuild
Footer: locally build package, build sln, then works
1 parent c9771bd commit 2963d4e

File tree

17 files changed

+82
-65
lines changed

17 files changed

+82
-65
lines changed

.github/workflows/dev.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,13 @@ jobs:
256256
- name: Debug VersionInfo.cs
257257
run: |
258258
cat Package.BlazorComponentLibrary/BCLVersion/VersionInfo.cs
259+
260+
- name: build whole solution now package built
261+
run: |
262+
dotnet build GitPageBlazorWASM.sln -c Release \
263+
/p:BCLVersion=$BCL_VERSION \
264+
/p:NupkgOutputPath=$NUPKG_OUTPUT_PATH \
265+
/p:UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE
259266
260267
# - name: List Created Package
261268
# run: ls -l $BCL_Local_Source
@@ -421,7 +428,7 @@ jobs:
421428
echo "doesnt work"
422429
423430
- name: Display Environment Variable (for debugging)
424-
run: echo "BCLVERSION is: $BCLVERSION"
431+
run: echo "BCLVERSION is $BCLVERSION"
425432

426433
- name: qqqqqqq here now try build
427434
run: |
@@ -441,6 +448,7 @@ jobs:
441448
/p:IsLocalDev=$IS_LOCAL_DEV \
442449
/p:BCLVersion=$BCL_VERSION \
443450
/p:UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE
451+
/p:GhPageRelease=true
444452
445453
446454
#include hidden so we get jekyll

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ jobs:
172172
- name: Publish client using client release .csproj logic
173173
run: |
174174
dotnet publish ./TestHostPrerenderWASM/TestHostPrerenderWASM.Client/TestHostPrerenderWASM.Client.csproj --configuration Release \
175-
/p:IsLocalDev=$IS_LOCAL_DEV \
176175
/p:BCLVersion=$BCL_VERSION \
177176
/p:UseBCLProjectReference=$USE_BCL_PROJECT_REFERENCE
178177

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<PackageVersion Include="AutoMapper" Version="1.1.0.118" />
1919
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
2020
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
21-
<PackageVersion Include="TELBlazorComponentLibrary.GitPageBlazorWasm" Version="$(BCLVersion)" />
22-
<!--<PackageVersion Include="TELBlazorComponentLibrary.GitPageBlazorWasm" Version="8.4.0-feat-version-work-on-branch-maybe.19-250410-1414" />-->
21+
<PackageVersion Include="TELBlazorComponentLibrary.GitPageBlazorWasm" Version="$(BCLVersion)" />
22+
<!--<PackageVersion Include="TELBlazorComponentLibrary.GitPageBlazorWasm" Version="8.4.0-feat-version-work-on-branch-maybe.19-250410-1414" />-->
2323
<PackageVersion Include="xunit" Version="2.5.3" />
2424
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
2525
</ItemGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
namespace Package.BlazorComponentLibrary.BCLVersion { public static class VersionInfo { public static string Version = "5.5.8" ;
1+
namespace Package.BlazorComponentLibrary.BCLVersion { public static class VersionInfo { public static string Version = "10.9.4" ;
22
} }

Package.BlazorComponentLibrary/Components/SimpleCounter.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<h3>Simple Counter</h3>
22
change
3+
<b>version from build process</b>
34
<span class="version-display">@Package.BlazorComponentLibrary.BCLVersion.VersionInfo.Version</span>
5+
<b>manually types</b>
6+
<span>5.6.9</span>
47
<button class="btn btn-primary" @onclick="IncrementCount">
58
surely not A Build aaa(@currentCount)
69
</button>

Package.BlazorComponentLibrary/Package.BlazorComponentLibrary.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<!--<Import Project="..\PackageSettings.props" Condition="Exists('..\PackageSettings.props')" /> auto imported by solution-->
44
<ItemGroup>
55
<None Include="..\README.md" Pack="true" PackagePath="\" />
6-
<!--<None Include="wwwroot\background.png" />-->
76
</ItemGroup>
87
<PropertyGroup>
98
<TargetFramework>net8.0</TargetFramework>
@@ -29,11 +28,6 @@
2928
<PackageOutputPath>$(NupkgOutputPath)</PackageOutputPath>
3029

3130
</PropertyGroup>
32-
<!--<Target Name="DebugProperties" BeforeTargets="Build">
33-
<Message Importance="high" Text="NupkgOutputPath: $(NupkgOutputPath)" />
34-
<Message Importance="high" Text="PackageOutputPath: $(PackageOutputPath)" />
35-
<Message Importance="high" Text="LocalPackagePath: $(LocalPackagePath)" />
36-
</Target>-->
3731

3832
<ItemGroup>
3933
<SupportedPlatform Include="browser" />
@@ -48,7 +42,7 @@
4842
<Content Remove="wwwroot\background.png" />
4943
</ItemGroup>
5044

51-
<Target Name="WriteBclVersionToFile" BeforeTargets="Build">
45+
<Target Name="WriteBclVersionToFile" BeforeTargets="PrepareForBuild">
5246
<WriteLinesToFile File="wwwroot/bclversion.txt" Lines="$(BCLVersion)" Overwrite="true" Encoding="UTF-8" />
5347
<WriteLinesToFile File="BCLVersion/VersionInfo.cs" Lines="namespace Package.BlazorComponentLibrary.BCLVersion { public static class VersionInfo { public static string Version = &quot;$(BCLVersion)&quot; %3B; } }" Overwrite="true" Encoding="UTF-8" />
5448
</Target>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.5.8
1+
10.9.4

PackageSettings.props

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,17 @@
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>$(Env:LocalPackagePath)</NupkgOutputPath>-->
65
<NupkgOutputPath>$(LocalPackagePath)</NupkgOutputPath>
7-
<IsLocalDevVS Condition="'$(IsLocalDev)' == '' ">false</IsLocalDevVS>
8-
<IsLocalDevVS Condition="'$(IsLocalDev)' != '' ">$(IsLocalDev)</IsLocalDevVS>
6+
97

108
<UseBCLProjectReference Condition="'$(UseBCLProjectReference)' == '' ">false</UseBCLProjectReference>
119
<UseBCLProjectReference Condition="'$(UseBCLProjectReference)' != '' ">$(UseBCLProjectReference)</UseBCLProjectReference>
12-
13-
<!--allows us to just use build versions while testing packages locally-->
14-
<!--<UseHighestBCLVersionAvailable>false</UseHighestBCLVersionAvailable>-->
15-
<!--<UseBCLProjectReference>$(UseBCLProjectReference)</UseBCLProjectReference>-->
16-
<!--wont have in environmental variable but useful for pipeline-->
10+
11+
<GhPageRelease Condition="'$(GhPageRelease)' == '' ">false</GhPageRelease>
12+
<GhPageRelease Condition="'$(UseBCLProjectReference)' != '' ">$(GhPageRelease)</GhPageRelease>
13+
1714
<BCLVersion>$(BCLVersion)</BCLVersion>
18-
<!--wont have in environmental variable but useful for pipeline-->
15+
1916
</PropertyGroup>
20-
<!-- it is there <Target Name="EnsureLocalFeed">
21-
<Exec Command="echo $(LocalPackagePath)" />
22-
</Target>-->
23-
<!--<Target Name="EnsureLocalFeed">
24-
<Exec Command="echo $(IsLocalDev)" />
25-
</Target>
26-
<Target Name="DiagnoseIsLocalDev" BeforeTargets="Build">
27-
<Message Text="!!!!!!!!!!!!!!!!! Property IsLocalDevVS: $(IsLocalDevVS)" Importance="high" />
28-
</Target>-->
17+
2918
</Project>

PackageSettings.props.local

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<!--warning unless do nuget.config.template localpackagepath for nuget will still use sys environment values-->
55
<LocalPackagePath>C:\LocalDevelopmentPackageVersions</LocalPackagePath>
66
<NupkgOutputPath>C:\LocalDevelopmentPackageVersions</NupkgOutputPath>
7-
<IsLocalDev>true</IsLocalDev>
7+
<GhPageRelease>false</GhPageRelease>
88
<UseBCLProjectReference>false</UseBCLProjectReference>
99
<!--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-->
10-
<BCLVersion>5.5.8</BCLVersion>
10+
<BCLVersion>10.9.4</BCLVersion>
1111
</PropertyGroup>
1212
</Project>

ReadMe.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11

2+
3+
4+
25
## qqqq unlike in nuget feed git package feed doesnt display this file so to see it you need to look in the actual nuget package
6+
7+
# Local Development
8+
- inc the version in local props
9+
- save
10+
- build package project (debug)
11+
- build solution (debug)
12+
- run
13+
- for wasm use release and client
14+
- for hosted wasm use host and debug
15+
16+
## Trouble shooting
17+
- clean restore solution and try again
18+
- look in the sharedpages, look in depenency in solution explorer, open the package version drop down
19+
- is the version what you expect?
20+
- is there an error
21+
- if it still doesnt work increment the version and use the process again
22+
23+
## Bonus
24+
- there is probably a way to increment version with timestamps or build number to automate it more
25+
26+
## extras
27+
- you can use a local feed two visual studio and see new components in LH for example
28+
- LH could be setup to automatically update too, system environment variables may help or a txt file to read in csproj to sinc versions
29+
330
# About
431

532

0 commit comments

Comments
 (0)