mirror of https://github.com/ospab/ostp.git
Fix: Re-export PaddingStrategy and anchor build.ps1 to project root with proper versioning
This commit is contained in:
parent
94b794b79a
commit
a107f74b8d
|
|
@ -4,5 +4,5 @@ pub mod protocol;
|
||||||
pub mod relay;
|
pub mod relay;
|
||||||
|
|
||||||
pub use crypto::NoiseRole;
|
pub use crypto::NoiseRole;
|
||||||
pub use framing::TrafficProfile;
|
pub use framing::{TrafficProfile, PaddingStrategy};
|
||||||
pub use protocol::{OstpEvent, OstpState, ProtocolAction, ProtocolConfig, ProtocolMachine};
|
pub use protocol::{OstpEvent, OstpState, ProtocolAction, ProtocolConfig, ProtocolMachine};
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
# OSTP Hybrid Build Script (Windows Native + WSL Linux)
|
# OSTP Hybrid Build Script (Windows Native + WSL Linux)
|
||||||
|
|
||||||
Write-Output "Starting OSTP Build Pipeline"
|
$ProjectRoot = Split-Path -Parent $PSScriptRoot
|
||||||
|
Push-Location $ProjectRoot
|
||||||
|
|
||||||
|
Write-Output "Starting OSTP Build Pipeline in $ProjectRoot"
|
||||||
|
|
||||||
# Stop any currently running instances to release file locks on compiled binaries
|
# Stop any currently running instances to release file locks on compiled binaries
|
||||||
Stop-Process -Name ostp -ErrorAction SilentlyContinue | Out-Null
|
Stop-Process -Name ostp -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
$DistDir = Join-Path $PSScriptRoot "dist"
|
$DistDir = Join-Path $ProjectRoot "dist"
|
||||||
$WinDist = Join-Path $DistDir "windows"
|
$WinDist = Join-Path $DistDir "windows"
|
||||||
$LinuxDist = Join-Path $DistDir "linux"
|
$LinuxDist = Join-Path $DistDir "linux"
|
||||||
|
|
||||||
|
|
@ -20,6 +23,7 @@ $env:CARGO_TARGET_DIR = $TempTarget
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
Write-Output "❌ Windows build failed"
|
Write-Output "❌ Windows build failed"
|
||||||
|
Pop-Location
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,6 +33,7 @@ if (Test-Path $WinExe) {
|
||||||
Write-Output "✔ Windows binary successfully copied to: dist/windows/ostp.exe"
|
Write-Output "✔ Windows binary successfully copied to: dist/windows/ostp.exe"
|
||||||
} else {
|
} else {
|
||||||
Write-Output "❌ Windows binary not found after build"
|
Write-Output "❌ Windows binary not found after build"
|
||||||
|
Pop-Location
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,17 +47,21 @@ if (Get-Command wsl -ErrorAction SilentlyContinue) {
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
Write-Output "❌ Linux build failed"
|
Write-Output "❌ Linux build failed"
|
||||||
|
Pop-Location
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copy from WSL native temp directory back to host
|
# Determine WSL translation of the destination folder
|
||||||
& wsl cp /tmp/ostp_linux_build/x86_64-unknown-linux-musl/release/ostp ./dist/linux/ostp
|
$WslLinuxDist = & wsl wslpath -u $LinuxDist
|
||||||
|
# Copy from WSL temp directory into the actual host mapped linux dist
|
||||||
|
& wsl cp /tmp/ostp_linux_build/x86_64-unknown-linux-musl/release/ostp $WslLinuxDist/ostp
|
||||||
|
|
||||||
$LinuxBin = Join-Path $LinuxDist "ostp"
|
$LinuxBin = Join-Path $LinuxDist "ostp"
|
||||||
if (Test-Path $LinuxBin) {
|
if (Test-Path $LinuxBin) {
|
||||||
Write-Output "✔ Linux binary successfully copied to dist/linux/ostp"
|
Write-Output "✔ Linux binary successfully copied to dist/linux/ostp"
|
||||||
} else {
|
} else {
|
||||||
Write-Output "❌ Linux binary copy failed"
|
Write-Output "❌ Linux binary copy failed"
|
||||||
|
Pop-Location
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -62,7 +71,7 @@ if (Get-Command wsl -ErrorAction SilentlyContinue) {
|
||||||
Write-Output "Build Completed Successfully"
|
Write-Output "Build Completed Successfully"
|
||||||
|
|
||||||
# Automated metadata version increment
|
# Automated metadata version increment
|
||||||
$CargoToml = Join-Path $PSScriptRoot "Cargo.toml"
|
$CargoToml = Join-Path $ProjectRoot "Cargo.toml"
|
||||||
if (Test-Path $CargoToml) {
|
if (Test-Path $CargoToml) {
|
||||||
$Content = [System.IO.File]::ReadAllText($CargoToml)
|
$Content = [System.IO.File]::ReadAllText($CargoToml)
|
||||||
if ($Content -match 'version\s*=\s*"(\d+)\.(\d+)\.(\d+)"') {
|
if ($Content -match 'version\s*=\s*"(\d+)\.(\d+)\.(\d+)"') {
|
||||||
|
|
@ -76,3 +85,5 @@ if (Test-Path $CargoToml) {
|
||||||
Write-Output "✔ Successfully bumped workspace version to $Major.$Minor.$NewPatch"
|
Write-Output "✔ Successfully bumped workspace version to $Major.$Minor.$NewPatch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Pop-Location
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue