Refactor release notes generation and version parsing
Changed the version extraction regex in Get-VersionFromSetup for improved accuracy. Refactored New-ReleaseNotes to build the release notes string incrementally instead of using a here-string, simplifying formatting and maintenance.
This commit is contained in:
@@ -38,7 +38,7 @@ $RELEASE_DATE = Get-Date -Format "yyyy-MM-dd"
|
|||||||
function Get-VersionFromSetup {
|
function Get-VersionFromSetup {
|
||||||
try {
|
try {
|
||||||
$setupContent = Get-Content "build\windows\setup.py" -Raw
|
$setupContent = Get-Content "build\windows\setup.py" -Raw
|
||||||
if ($setupContent -match 'version\s*=\s*["\']([^"\']+)["\']') {
|
if ($setupContent -match 'version="([^"]*)"') {
|
||||||
$version = $matches[1]
|
$version = $matches[1]
|
||||||
Write-Host "Detected version: $version" -ForegroundColor Gray
|
Write-Host "Detected version: $version" -ForegroundColor Gray
|
||||||
return $version
|
return $version
|
||||||
@@ -312,37 +312,28 @@ function Move-MSIFiles {
|
|||||||
function New-ReleaseNotes {
|
function New-ReleaseNotes {
|
||||||
Write-Step "Creating release notes..."
|
Write-Step "Creating release notes..."
|
||||||
|
|
||||||
$releaseNotes = @"
|
$releaseNotes = "# YTSage v$SCRIPT_VERSION Release`n`n"
|
||||||
# YTSage v$SCRIPT_VERSION Release
|
$releaseNotes += "**Release Date:** $RELEASE_DATE`n"
|
||||||
|
$releaseNotes += "**Build Type:** $BUILD_TYPE`n`n"
|
||||||
**Release Date:** $RELEASE_DATE
|
$releaseNotes += "## Installation Options`n`n"
|
||||||
**Build Type:** $BUILD_TYPE
|
$releaseNotes += "### MSI Installer (Recommended)`n"
|
||||||
|
$releaseNotes += "- **File:** $OUTPUT_NAME_BASE.msi`n"
|
||||||
## Installation Options
|
$releaseNotes += "- **Installation:** Double-click to install system-wide`n"
|
||||||
|
$releaseNotes += "- **Updates:** Automatic update notifications`n"
|
||||||
### MSI Installer (Recommended)
|
$releaseNotes += "- **Uninstall:** Via Windows Programs `& Features`n`n"
|
||||||
- **File:** $OUTPUT_NAME_BASE.msi
|
$releaseNotes += "### Portable ZIP`n"
|
||||||
- **Installation:** Double-click to install system-wide
|
$releaseNotes += "- **File:** $OUTPUT_NAME_BASE.zip`n"
|
||||||
- **Updates:** Automatic update notifications
|
$releaseNotes += "- **Installation:** Extract and run - no installation required`n"
|
||||||
- **Uninstall:** Via Windows Programs & Features
|
$releaseNotes += "- **Updates:** Manual download and replacement`n"
|
||||||
|
$releaseNotes += "- **Uninstall:** Simply delete the folder`n`n"
|
||||||
### Portable ZIP
|
$releaseNotes += "## System Requirements`n"
|
||||||
- **File:** $OUTPUT_NAME_BASE.zip
|
$releaseNotes += "- Windows 10/11 64-bit`n"
|
||||||
- **Installation:** Extract and run - no installation required
|
$releaseNotes += "- .NET Framework 4.7.2 or later`n"
|
||||||
- **Updates:** Manual download and replacement
|
$releaseNotes += "- Internet connection for yt-dlp updates`n`n"
|
||||||
- **Uninstall:** Simply delete the folder
|
$releaseNotes += "## Support`n"
|
||||||
|
$releaseNotes += "For issues or questions, please visit the project repository.`n`n"
|
||||||
## System Requirements
|
$releaseNotes += "---`n"
|
||||||
- Windows 10/11 (64-bit)
|
$releaseNotes += "*Built with cx_Freeze*`n"
|
||||||
- .NET Framework 4.7.2 or later
|
|
||||||
- Internet connection for yt-dlp updates
|
|
||||||
|
|
||||||
## Support
|
|
||||||
For issues or questions, please visit the project repository.
|
|
||||||
|
|
||||||
---
|
|
||||||
*Built with cx_Freeze v$(pip show cx_Freeze | Select-String "Version" | ForEach-Object { ($_ -split ":")[1].Trim() })*
|
|
||||||
"@
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$releaseNotesPath = Join-Path $OutputDir "RELEASE_NOTES.md"
|
$releaseNotesPath = Join-Path $OutputDir "RELEASE_NOTES.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user