Release v0.1.5.4 prepare for release
This commit is contained in:
@ -78,13 +78,15 @@ if (Test-Path "build\CTestTestfile.cmake") {
|
||||
# Optional: clang-cl Coverage bauen und HTML-Report als Artefakt paketieren
|
||||
Write-Host "Erzeuge optionalen Coverage-Report (clang-cl + LLVM), falls Tools vorhanden sind..." -ForegroundColor Yellow
|
||||
try {
|
||||
$llvmCov = "C:\\Program Files\\LLVM\\bin\\llvm-cov.exe"
|
||||
$llvmProf = "C:\\Program Files\\LLVM\\bin\\llvm-profdata.exe"
|
||||
$llvmCov = "C:\Program Files\LLVM\bin\llvm-cov.exe"
|
||||
$llvmProf = "C:\Program Files\LLVM\bin\llvm-profdata.exe"
|
||||
$llvmCovExists = Test-Path $llvmCov
|
||||
$llvmProfExists = Test-Path $llvmProf
|
||||
|
||||
if ($llvmCovExists -and $llvmProfExists) {
|
||||
$toolchain = Join-Path $env:USERPROFILE 'vcpkg\scripts\buildsystems\vcpkg.cmake'
|
||||
$haveToolchain = Test-Path $toolchain
|
||||
|
||||
$cmakeArgs = @(
|
||||
'-S','.',
|
||||
'-B','build-clang',
|
||||
@ -95,23 +97,33 @@ try {
|
||||
("-DLLVM_PROFDATA={0}" -f $llvmProf),
|
||||
("-DLLVM_COV={0}" -f $llvmCov)
|
||||
)
|
||||
|
||||
if ($haveToolchain) {
|
||||
$cmakeArgs += ("-DCMAKE_TOOLCHAIN_FILE={0}" -f $toolchain)
|
||||
$cmakeArgs += '-DVCPKG_TARGET_TRIPLET=x64-windows'
|
||||
}
|
||||
|
||||
& cmake @cmakeArgs | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) { throw "CMake-Konfiguration für Coverage fehlgeschlagen" }
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "CMake-Konfiguration für Coverage fehlgeschlagen"
|
||||
}
|
||||
|
||||
# Run coverage target with integration tests disabled to avoid rate limits
|
||||
$env:PRIVATEBIN_IT = '0'
|
||||
& cmake --build build-clang --config Release --target coverage_llvm
|
||||
if ($LASTEXITCODE -ne 0) { throw "Coverage-Build fehlgeschlagen" }
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Coverage-Build fehlgeschlagen"
|
||||
}
|
||||
|
||||
$htmlDir = "build-clang/coverage/html"
|
||||
$htmlDir = "build-clang\coverage\html"
|
||||
if (Test-Path $htmlDir) {
|
||||
if (-not (Test-Path 'dist')) { New-Item -ItemType Directory -Path 'dist' | Out-Null }
|
||||
$zipPath = "dist/coverage_html.zip"
|
||||
if (Test-Path $zipPath) { Remove-Item -Force $zipPath }
|
||||
if (-not (Test-Path 'dist')) {
|
||||
New-Item -ItemType Directory -Path 'dist' | Out-Null
|
||||
}
|
||||
$zipPath = "dist\coverage_html.zip"
|
||||
if (Test-Path $zipPath) {
|
||||
Remove-Item -Force $zipPath
|
||||
}
|
||||
Compress-Archive -Path "$htmlDir\*" -DestinationPath $zipPath
|
||||
Write-Host "Coverage-HTML nach $zipPath gepackt." -ForegroundColor Green
|
||||
} else {
|
||||
@ -124,15 +136,16 @@ try {
|
||||
Write-Host "Warnung: Coverage-Erzeugung fehlgeschlagen: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
<#
|
||||
Commit & Push, Tag & Push
|
||||
#>
|
||||
# Commit & Push, Tag & Push
|
||||
# Änderungen committen
|
||||
$status = git status --porcelain
|
||||
if ($status) {
|
||||
git add -A
|
||||
git commit -m "Release $newVersion prepare for release"
|
||||
if ($LASTEXITCODE -ne 0) { Write-Host "Commit fehlgeschlagen." -ForegroundColor Red; exit 1 }
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Commit fehlgeschlagen." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Remote/Repo-Infos ermitteln
|
||||
@ -143,7 +156,10 @@ if (-not $remoteUrl) {
|
||||
}
|
||||
|
||||
# Host, Owner, Repo aus URL extrahieren (https oder ssh)
|
||||
$gitHost = $null; $owner = $null; $repoName = $null
|
||||
$gitHost = $null
|
||||
$owner = $null
|
||||
$repoName = $null
|
||||
|
||||
if ($remoteUrl -match '^(https?://)([^/]+)/(.+?)(?:\.git)?$') {
|
||||
$gitHost = $matches[2]
|
||||
$path = $matches[3]
|
||||
@ -151,6 +167,7 @@ if ($remoteUrl -match '^(https?://)([^/]+)/(.+?)(?:\.git)?$') {
|
||||
$gitHost = $matches[1]
|
||||
$path = $matches[2]
|
||||
}
|
||||
|
||||
if ($path) {
|
||||
$parts = $path.Split('/')
|
||||
if ($parts.Length -ge 2) {
|
||||
@ -158,6 +175,7 @@ if ($path) {
|
||||
$repoName = $parts[$parts.Length-1]
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $gitHost -or -not $owner -or -not $repoName) {
|
||||
Write-Host "Fehler: Konnte Host/Owner/Repo aus Remote-URL nicht ermitteln: $remoteUrl" -ForegroundColor Red
|
||||
exit 1
|
||||
@ -165,7 +183,11 @@ if (-not $gitHost -or -not $owner -or -not $repoName) {
|
||||
|
||||
# Tag erstellen und pushen
|
||||
git tag -a $newVersion -m "Release $newVersion"
|
||||
if ($LASTEXITCODE -ne 0) { Write-Host "Tag-Erstellung fehlgeschlagen." -ForegroundColor Red; exit 1 }
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Tag-Erstellung fehlgeschlagen." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
git push origin $newVersion
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Tag-Push fehlgeschlagen. Stelle sicher, dass Du Push-Rechte besitzt." -ForegroundColor Red
|
||||
@ -195,6 +217,7 @@ $headers = @{
|
||||
}
|
||||
|
||||
$releaseUri = "https://$gitHost/api/v1/repos/$owner/$repoName/releases"
|
||||
|
||||
try {
|
||||
$release = Invoke-RestMethod -Uri $releaseUri -Method Post -Headers $headers -Body $releaseData -ErrorAction Stop
|
||||
} catch {
|
||||
@ -259,5 +282,4 @@ if (Test-Path $distPath) {
|
||||
Write-Host "dist-Ordner nicht gefunden!" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "Release-Erstellung abgeschlossen!" -ForegroundColor Green
|
||||
|
||||
Write-Host "Release-Erstellung abgeschlossen!" -ForegroundColor Green
|
||||
Reference in New Issue
Block a user