Release v0.1.5.4 prepare for release
This commit is contained in:
@ -120,17 +120,59 @@ try {
|
||||
Write-Host "Warnung: Coverage-Erzeugung fehlgeschlagen: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
<#
|
||||
Commit & Push, Tag & Push
|
||||
#>
|
||||
# Änderungen committen
|
||||
$status = git status --porcelain
|
||||
if ($status) {
|
||||
git add -A
|
||||
git commit -m "Release $newVersion prepare for release"
|
||||
git push origin HEAD
|
||||
if ($LASTEXITCODE -ne 0) { Write-Host "Commit fehlgeschlagen." -ForegroundColor Red; exit 1 }
|
||||
}
|
||||
|
||||
# Remote/Repo-Infos ermitteln
|
||||
$remoteUrl = git remote get-url origin 2>$null
|
||||
if (-not $remoteUrl) {
|
||||
Write-Host "Fehler: Kein Git-Remote 'origin' gefunden." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Host, Owner, Repo aus URL extrahieren (https oder ssh)
|
||||
$gitHost = $null; $owner = $null; $repoName = $null
|
||||
if ($remoteUrl -match '^(https?://)([^/]+)/(.+?)(?:\.git)?$') {
|
||||
$gitHost = $matches[2]
|
||||
$path = $matches[3]
|
||||
} elseif ($remoteUrl -match '^[^@]+@([^:]+):(.+?)(?:\.git)?$') {
|
||||
$gitHost = $matches[1]
|
||||
$path = $matches[2]
|
||||
}
|
||||
if ($path) {
|
||||
$parts = $path.Split('/')
|
||||
if ($parts.Length -ge 2) {
|
||||
$owner = $parts[$parts.Length-2]
|
||||
$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
|
||||
}
|
||||
|
||||
# Tag erstellen und pushen
|
||||
git tag -a $newVersion -m "Release $newVersion"
|
||||
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
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Vor Upload: Artefakte einsammeln (dist)
|
||||
if (Test-Path "scripts\collect_binaries.ps1") {
|
||||
Write-Host "Sammle Build-Artefakte (scripts/collect_binaries.ps1)..." -ForegroundColor Yellow
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\collect_binaries.ps1
|
||||
}
|
||||
|
||||
# Release erstellen
|
||||
$releaseBody = "## What is New in $newVersion`n`n- AUTOMATED: Release created by script`n- VERSION: Bumped from $lastTag to $newVersion`n- BUILD: Automatic build with build_windows.bat`n`n## Build Artifacts`n`nBuild-Artefakte werden automatisch hochgeladen und hier angezeigt.`n`nTypische Artefakte:`n- privatebinapi.dll - Windows Dynamic Link Library`n- privatebinapi.lib - Windows Import Library`n- example.exe - Combined example program`n- privatebinapi.h - C++ header file"
|
||||
@ -148,8 +190,13 @@ $headers = @{
|
||||
"Content-Type" = "application/json"
|
||||
}
|
||||
|
||||
$releaseUri = "https://gitea.medisoftware.org/api/v1/repos/Markus/lib-privatebin/releases"
|
||||
$release = Invoke-RestMethod -Uri $releaseUri -Method Post -Headers $headers -Body $releaseData
|
||||
$releaseUri = "https://$gitHost/api/v1/repos/$owner/$repoName/releases"
|
||||
try {
|
||||
$release = Invoke-RestMethod -Uri $releaseUri -Method Post -Headers $headers -Body $releaseData -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Host "Fehler beim Erstellen des Releases: $($_.Exception.Message)" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Release erstellt: $($release.id)" -ForegroundColor Green
|
||||
Write-Host "URL: $($release.html_url)" -ForegroundColor Green
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
|
||||
static bool extract_paste_id_and_key(const std::string& full_url, std::string& paste_id, std::string& key) {
|
||||
@ -143,6 +145,9 @@ int main() {
|
||||
free_string(delete_token);
|
||||
free_string(fetched);
|
||||
|
||||
// Respect server rate limit between submissions
|
||||
std::this_thread::sleep_for(std::chrono::seconds(12));
|
||||
|
||||
// Test 2: Syntax highlighting format
|
||||
std::cout << "[test] 2. Testing syntax highlighting format..." << std::endl;
|
||||
const char* code_content = R"(
|
||||
@ -206,6 +211,9 @@ int main() {
|
||||
free_string(code_delete_token);
|
||||
free_string(code_fetched);
|
||||
|
||||
// Pause again before next submission
|
||||
std::this_thread::sleep_for(std::chrono::seconds(12));
|
||||
|
||||
// Test 3: Markdown format
|
||||
std::cout << "[test] 3. Testing markdown format..." << std::endl;
|
||||
const char* markdown_content = R"(
|
||||
@ -274,6 +282,9 @@ std::cout << x << std::endl;
|
||||
free_string(markdown_delete_token);
|
||||
free_string(markdown_fetched);
|
||||
|
||||
// Pause again before next submission
|
||||
std::this_thread::sleep_for(std::chrono::seconds(12));
|
||||
|
||||
// Test 4: File upload via API
|
||||
{
|
||||
std::cout << "[test] 4. Testing file upload..." << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user