From f4703d2cb53f42bfe65728d6aef11922e64ffeb1 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 18 Apr 2026 04:35:05 -0400 Subject: [PATCH] fix(release): make release.sh portable across macOS and Linux The nightly release workflow runs on Linux, but the script was written with BSD-only idioms and had only ever been executed from a Mac. Every scheduled nightly had been failing; the last successful nightly tag was cut manually. - days_since_2026: replace `date -j -f` (BSD) with a python3 one-liner - sed -i: use the portable `sed -i.bak` + rm pattern; empty-suffix `sed -i ''` is a BSD-ism that breaks GNU sed's arg parsing Co-Authored-By: Claude Opus 4.7 (1M context) --- bin/dev/release.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/dev/release.sh b/bin/dev/release.sh index 86de33ec7..d89554d49 100755 --- a/bin/dev/release.sh +++ b/bin/dev/release.sh @@ -12,10 +12,7 @@ release_date() { days_since_2026() { local target_date="$1" - local epoch_2026 epoch_target - epoch_2026=$(date -j -f "%Y-%m-%d" "2026-01-01" "+%s") - epoch_target=$(date -j -f "%Y-%m-%d" "$target_date" "+%s") - printf '%s\n' $(( (epoch_target - epoch_2026) / 86400 )) + python3 -c "from datetime import date; print((date.fromisoformat('$target_date') - date(2026, 1, 1)).days)" } next_base_version() { @@ -150,7 +147,8 @@ main() { return 0 fi - sed -i '' "s/^version = \"$current_version\"/version = \"$new_version\"/" "$cargo_toml" + sed -i.bak "s/^version = \"$current_version\"/version = \"$new_version\"/" "$cargo_toml" + rm "${cargo_toml}.bak" echo "Updated $cargo_toml" cargo update --workspace