Skip to content

Commit e1ccd2c

Browse files
committed
fix: Improve release package with proper README and LICENSE formats
1 parent 995cc2f commit e1ccd2c

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,28 @@ jobs:
3939
$zipName = "AddToPath-v${version}-win-x64.zip"
4040
# First check if files exist
4141
Get-ChildItem -Path "bin/Release" -ErrorAction Continue
42-
# Create ZIP with proper path
43-
Compress-Archive -Path "bin/Release/*" -DestinationPath $zipName -Force
42+
# Create a temporary directory for the release
43+
New-Item -ItemType Directory -Path "release-temp" -Force
44+
# Copy executables
45+
Copy-Item "bin/Release/*" -Destination "release-temp" -Recurse
46+
# Include both README formats and LICENSE
47+
Copy-Item "README.md" -Destination "release-temp" -ErrorAction SilentlyContinue
48+
if (Test-Path "README.md") {
49+
$readme = Get-Content "README.md" -Raw
50+
# Remove Markdown formatting (basic conversion)
51+
$readme = $readme -replace '#+ ', '' `
52+
-replace '\[([^\]]+)\]\([^\)]+\)', '$1' `
53+
-replace '\*\*([^\*]+)\*\*', '$1' `
54+
-replace '`([^`]+)`', '$1'
55+
Set-Content -Path "release-temp/README.txt" -Value $readme -Encoding UTF8
56+
}
57+
if (Test-Path "LICENSE") {
58+
Copy-Item "LICENSE" -Destination "release-temp/LICENSE.txt"
59+
}
60+
# Create ZIP with all files
61+
Compress-Archive -Path "release-temp/*" -DestinationPath $zipName -Force
62+
# Cleanup
63+
Remove-Item "release-temp" -Recurse -Force
4464
4565
- name: Generate Release Notes
4666
id: release_notes

0 commit comments

Comments
 (0)