more or less still dont know
release / build (push) Successful in 2m18s

This commit is contained in:
lda
2025-08-25 06:21:12 +07:00 Unverified
parent 9aa1c44246
commit 2392477ec8
8 changed files with 122 additions and 138 deletions
+15 -11
View File
@@ -1,9 +1,17 @@
# Publish to registry and tag
# Usage: ./scripts/publish.ps1 -Version 0.1.0 -Tag
# Publish to registry and tag (manual; CI does not use this)
# Usage:
# ./scripts/publish.ps1 -Version 0.1.0 -Publish # publish to your configured Cargo registry (crates.io or Gitea)
# ./scripts/publish.ps1 -Version 0.1.0 -Tag # create/push git tag v0.1.0
# ./scripts/publish.ps1 -Version 0.1.0 -Publish -Tag # both
# ./scripts/publish.ps1 -Version 0.1.0 -Publish -Registry gitea # publish to named registry
param(
[string]$Version,
[switch]$Tag,
[switch]$Publish
[switch]$ForceTag,
[string]$Registry
)
$ErrorActionPreference = 'Stop'
@@ -18,19 +26,15 @@ if ($Version) {
cargo build --release
# Publish crate (only if -Publish and registry auth is available)
# Publish crate (only if -Publish). Relies on your Cargo config/credentials.
if ($Publish) {
$token = $env:CARGO_REGISTRIES_CRATES_IO_TOKEN
if (-not $token) { $token = $env:CARGO_REGISTRY_TOKEN }
if (-not $token) {
Write-Warning "No registry token found (CARGO_REGISTRIES_CRATES_IO_TOKEN or CARGO_REGISTRY_TOKEN). Skipping cargo publish."
try {
$pubArgs = @('publish')
if ($Registry) { $pubArgs += @('--registry', $Registry) }
cargo @pubArgs
}
else {
try {
cargo publish
}
catch {
Write-Warning ("cargo publish failed: {0}" -f $_)
}
catch {
Write-Warning ("cargo publish failed: {0}" -f $_)
}
}