Skip to content

Commit db766cd

Browse files
committed
Fix source code directory structure
1 parent 5fc23ff commit db766cd

1 file changed

Lines changed: 11 additions & 23 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,33 +70,21 @@ jobs:
7070
- name: Create Source Archive
7171
shell: pwsh
7272
run: |
73-
# Create source code archive (exclude .git, bin, obj, .vs, etc.)
74-
$excludePatterns = @('.git', '.github', 'bin', 'obj', '.vs', '.vscode', '*.user', 'packages', '.nuget')
75-
7673
$sourceDir = "."
7774
$archiveName = "SourceCode-${{ steps.version.outputs.version }}.zip"
7875
79-
# Create temporary file list
80-
$tempFileList = New-TemporaryFile
81-
Get-ChildItem -Path $sourceDir -Recurse -File |
82-
Where-Object {
83-
$file = $_
84-
$excluded = $false
85-
foreach ($pattern in $excludePatterns) {
86-
if ($file.FullName -like "*$pattern*") {
87-
$excluded = $true
88-
break
89-
}
90-
}
91-
-not $excluded
92-
} |
93-
ForEach-Object { $_.FullName -replace [regex]::Escape("$sourceDir\"), "" } |
94-
Out-File -FilePath $tempFileList -Encoding UTF8
95-
96-
# Create archive
97-
7z a -w $sourceDir $archiveName @$tempFileList
76+
# Create archive with directory structure preserved, excluding specific folders
77+
7z a -r $archiveName $sourceDir `
78+
-x!.git `
79+
-x!.github `
80+
-x!bin `
81+
-x!obj `
82+
-x!.vs `
83+
-x!.vscode `
84+
-x!packages `
85+
-x!.nuget `
86+
-x!"*.user"
9887
99-
Remove-Item $tempFileList
10088
Write-Host "Created source archive: $archiveName"
10189
10290
- name: Create Executable Archive

0 commit comments

Comments
 (0)