|
39 | 39 | $zipName = "AddToPath-v${version}-win-x64.zip" |
40 | 40 | # First check if files exist |
41 | 41 | 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 |
44 | 64 |
|
45 | 65 | - name: Generate Release Notes |
46 | 66 | id: release_notes |
|
0 commit comments