CI/CD: Decouple build.ps1 from gh CLI and fully migrate release publishing to GitHub Actions via automatic Git tagging

This commit is contained in:
ospab 2026-05-14 23:04:30 +03:00
parent c58ca91ed5
commit 31892ca2cf
1 changed files with 22 additions and 31 deletions

View File

@ -184,42 +184,33 @@ if ($ReleaseArchives.Count -gt 0) {
} }
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
# PHASE 3: AUTOMATED GITHUB PUBLISHING (Via User configured GH CLI) # PHASE 3: TRIGGER GLOBAL CI/CD RELEASE PIPELINE (Via Git Tag)
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
Write-Output "`n=========================================================" Write-Output "`n========================================================="
Write-Output " PHASE 3: Automated GitHub Release Deployment" Write-Output " PHASE 3: Launching Unified Global Cloud Release"
Write-Output "=========================================================" Write-Output "========================================================="
if (Get-Command gh -ErrorAction SilentlyContinue) { Write-Output "Synchronizing workspace version metadata to origin master..."
Write-Output "Assessing GitHub authentication credentials..." # Commit current Cargo.toml bump to establish version lineage
& gh auth status *>&1 | Out-Null & git add Cargo.toml
& git commit -m "CI/CD: prepare version v$Version [skip ci]" --allow-empty | Out-Null
if ($LASTEXITCODE -eq 0) { & git push origin master | Out-Null
Write-Output "✔ GitHub authenticated. Pushing workspace changes and tagging..."
Write-Output "Generating release tracking tag: v$Version"
# Synchronize current Git tree to ensure tag maps to active HEAD # Purge local tracking tag if pre-existing to guarantee clean sync
& git add Cargo.toml; & git commit -m "Release preparation: bump version to v$Version [skip ci]"; & git push & git tag -d "v$Version" 2>&1 | Out-Null
& git tag "v$Version"
Write-Output "Constructing Release on remote repository..."
Write-Output "Deploying trigger tag to GitHub..."
# Assemble formatted array of quotes paths for release payloads # Pushing the tag forces GitHub Actions to instantly spin up the cloud builders
$FilePaths = $ReleaseArchives | ForEach-Object { "`"$_`"" } & git push origin "v$Version" --force
# Trigger gh release mechanism with automated changelog generation if ($LASTEXITCODE -eq 0) {
$ReleaseCmd = "gh release create v$Version --title `"Release v$Version`" --notes `"Official cross-platform distribution of Ospab Stealth Transport Protocol (OSTP).`" --generate-notes " + ($FilePaths -join " ") Write-Output "`n🚀 EXCELLENT! Release trigger successfully synchronized with Cloud runners!"
Write-Output "✨ GitHub Actions is now compiling all 13 architectures in parallel."
Invoke-Expression $ReleaseCmd Write-Output "🔗 Live monitoring link: https://github.com/ospab/ostp/actions"
if ($LASTEXITCODE -eq 0) {
Write-Output "`n🚀 HOORAY! Universal Release v$Version is officially LIVE on GitHub!"
} else {
Write-Output "`n❌ Deployment failed during gh CLI upload."
}
} else {
Write-Output "⚠ gh CLI not logged in. Use 'gh auth login' inside your terminal to authorize auto-deployment."
}
} else { } else {
Write-Output " gh CLI is not present on the PATH. Skipping automatic GitHub publication." Write-Output "`n❌ Failed to deliver release tag to remote origin."
} }
Pop-Location Pop-Location