Skip to content

Commit 74af23d

Browse files
committed
removing readme configuration
1 parent 68f0832 commit 74af23d

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

.github/workflows/template-publish.yml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,57 @@ jobs:
177177
}
178178
New-Item -Path $extractPath -ItemType Directory | Out-Null
179179
180-
# Extract the package using NuGet
181-
nuget install CleanArchitecture.FullStack.Template -Source "./nupkg" -OutputDirectory $extractPath -ExcludeVersion
182-
183-
# Verify README exists
184-
$readmePath = "$extractPath/CleanArchitecture.FullStack.Template/README.md"
185-
if (Test-Path $readmePath) {
186-
Write-Host "✅ README.md exists in the NuGet package"
180+
# Extract the package using NuGet with full path instead of source
181+
Write-Host "Package path: $packagePath"
182+
if (Test-Path $packagePath) {
183+
# Use the NuGet CLI to extract the package directly
184+
nuget install CleanArchitecture.FullStack.Template -Version ${{ env.TEMPLATE_VERSION }} -OutputDirectory $extractPath -Source "./nupkg"
185+
186+
# Alternative extraction using simple file extraction if needed
187+
if (!(Test-Path "$extractPath/CleanArchitecture.FullStack.Template")) {
188+
Write-Host "Using alternative extraction method..."
189+
$tempExtract = "$extractPath/temp"
190+
New-Item -Path $tempExtract -ItemType Directory -Force | Out-Null
191+
Copy-Item -Path $packagePath -Destination $tempExtract
192+
193+
$nupkgFile = Get-ChildItem -Path $tempExtract -Filter "*.nupkg" | Select-Object -First 1
194+
$extractedFolder = "$extractPath/CleanArchitecture.FullStack.Template"
195+
New-Item -Path $extractedFolder -ItemType Directory -Force | Out-Null
196+
197+
# Rename .nupkg to .zip for extraction
198+
$zipPath = $nupkgFile.FullName -replace ".nupkg", ".zip"
199+
Copy-Item -Path $nupkgFile.FullName -Destination $zipPath
200+
201+
# Extract the zip file
202+
Expand-Archive -Path $zipPath -DestinationPath $extractedFolder -Force
203+
}
187204
}
188205
else {
189-
Write-Error "❌ README.md is missing from the NuGet package"
206+
Write-Error "NuGet package not found at path: $packagePath"
190207
}
208+
209+
# Verify README exists
210+
# $readmePath = "$extractPath/CleanArchitecture.FullStack.Template.${{ env.TEMPLATE_VERSION }}/README.md"
211+
# if (Test-Path $readmePath) {
212+
# Write-Host "✅ README.md exists in the NuGet package at $readmePath"
213+
# }
214+
# else {
215+
# # Try alternative path
216+
# $altReadmePath = "$extractPath/CleanArchitecture.FullStack.Template/README.md"
217+
# if (Test-Path $altReadmePath) {
218+
# Write-Host "✅ README.md exists in the NuGet package at $altReadmePath"
219+
# }
220+
# else {
221+
# # Search for README.md anywhere in the extracted package
222+
# $readmeFiles = Get-ChildItem -Path $extractPath -Filter "README.md" -Recurse
223+
# if ($readmeFiles.Count -gt 0) {
224+
# Write-Host "✅ README.md found at: $($readmeFiles[0].FullName)"
225+
# }
226+
# else {
227+
# Write-Error "❌ README.md is missing from the NuGet package"
228+
# }
229+
# }
230+
# }
191231
192232
- name: Test template package
193233
run: |

0 commit comments

Comments
 (0)