From 2e7efd4e6a5c7464c47fe88119a087dbbd614e12 Mon Sep 17 00:00:00 2001 From: nym21 Date: Wed, 5 Aug 2026 18:51:45 +0200 Subject: [PATCH] scripts: publish --- scripts/rust-publish.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/rust-publish.sh b/scripts/rust-publish.sh index b9e6c0994..3bdb902a2 100755 --- a/scripts/rust-publish.sh +++ b/scripts/rust-publish.sh @@ -1,10 +1,26 @@ #!/bin/bash -set -e +set -eo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" ROOT_DIR="$SCRIPT_DIR/.." cd "$ROOT_DIR" + +# brk_website embeds ignored assets through symlinks, so Cargo requires +# --allow-dirty even when the Git worktree itself is clean. +cargo release publish --package brk_logger --execute --no-confirm + +PUBLISH_LOG=$(mktemp -t brk-rust-publish) +trap 'rm -f "$PUBLISH_LOG"' EXIT + +if cargo publish --package brk_website --allow-dirty 2>&1 | tee "$PUBLISH_LOG"; then + : +elif grep -q "already exists on" "$PUBLISH_LOG"; then + echo "brk_website is already published; skipping" +else + exit 1 +fi + cargo release publish --workspace --execute --no-confirm echo "Done!"