diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 2b6ecbe..7318ec7 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -23,15 +23,19 @@ jobs: $version = "${{ gitea.ref_name }}".TrimStart("v") Write-Host "Setting version to: $version" - # Update csproj + # Update csproj (preserve UTF-8 BOM encoding) $csprojPath = "DellMonitorControl/DellMonitorControl.csproj" - (Get-Content $csprojPath) -replace '.*', "$version" | Set-Content $csprojPath - (Get-Content $csprojPath) -replace '.*', "$version.0" | Set-Content $csprojPath - (Get-Content $csprojPath) -replace '.*', "$version.0" | Set-Content $csprojPath + $content = [System.IO.File]::ReadAllText($csprojPath) + $content = $content -replace '.*', "$version" + $content = $content -replace '.*', "$version.0" + $content = $content -replace '.*', "$version.0" + [System.IO.File]::WriteAllText($csprojPath, $content, [System.Text.UTF8Encoding]::new($true)) # Update ISS $issPath = "DellMonitorControl/MonitorControl.iss" - (Get-Content $issPath) -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$version`"" | Set-Content $issPath + $issContent = [System.IO.File]::ReadAllText($issPath) + $issContent = $issContent -replace '#define MyAppVersion ".*"', "#define MyAppVersion `"$version`"" + [System.IO.File]::WriteAllText($issPath, $issContent, [System.Text.UTF8Encoding]::new($true)) - name: Restore dependencies run: dotnet restore