mirror of
https://github.com/tribufu/sdk-rust
synced 2025-06-15 18:54:19 +00:00
Create publish.ps1
This commit is contained in:
34
scripts/publish.ps1
Normal file
34
scripts/publish.ps1
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
$crates = @(
|
||||||
|
"tribufu-types",
|
||||||
|
"tribufu-constants",
|
||||||
|
"tribufu-api",
|
||||||
|
"mintaka"
|
||||||
|
)
|
||||||
|
|
||||||
|
$batchSize = 6
|
||||||
|
$waitTime = 300
|
||||||
|
|
||||||
|
function Process-Batch {
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory=$true)]
|
||||||
|
[array]$batch
|
||||||
|
)
|
||||||
|
|
||||||
|
foreach ($element in $batch) {
|
||||||
|
Write-Output "Processing element $element"
|
||||||
|
cargo publish --package $element
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i = 0; $i -lt $crates.Count; $i += $batchSize) {
|
||||||
|
$currentBatch = $crates[$i..($i + $batchSize - 1)]
|
||||||
|
|
||||||
|
Process-Batch -batch $currentBatch
|
||||||
|
|
||||||
|
if ($i -lt ($crates.Count - $batchSize)) {
|
||||||
|
Write-Output "Waiting for $waitTime seconds..."
|
||||||
|
Start-Sleep -Seconds $waitTime
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user