beads/scripts
matt wilkie df2078b56f
fix(ci): collapse multiline expression in cross-version-smoke workflow (#3189)
* fix(ci): collapse multiline expression in cross-version-smoke workflow

Multi-line plain YAML scalars are invalid — the ${{ }} expression
spanning multiple lines caused GitHub to reject the workflow file
immediately (0s, "workflow file issue") on every push to main.

Collapse to a single-line expression; semantics are unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(ci): fix smoke test CWD, mode check, --silent compat, and prefix dots

Three independent bugs causing all 5 upgrade smoke scenarios to fail:

1. Smoke test CWD (root cause of most failures)
   - All `bd` invocations ran from the test script's CWD (the beads repo
     checkout), not from the isolated workspace $WS. This caused:
     * bd init to detect the beads repo's `origin` remote (has
       refs/dolt/data) and clone the entire beads Dolt database into $WS,
       corrupting the upgrade scenario and wasting minutes on chunk downloads.
     * `git config beads.role` to be written to the beads repo's git config
       instead of $WS's, so scenario 4's role check always failed.
   - Fix: add `prev()` and `cand()` helpers that cd into $WS before running.

2. `create --silent` not in binaries older than ~v1.1.0
   - --silent was added after the v1.0.0 release; calling it with older
     binaries silently failed (error to stderr, empty stdout), making every
     create attempt look like an init failure.
   - Fix: `prev_create()` helper tries --silent first, falls back to
     parsing any ID-like token from plain create output.

3. Mode preservation check used wrong path
   - Embedded Dolt stores data in `.beads/embeddeddolt/` (a directory).
     The test checked for `.beads/beads.db` (a file), which never exists
     in embedded mode, so the "DB exists before/after upgrade" assertions
     always failed.
   - Fix: `embedded_db_exists()` checks for either the directory
     (current embedded mode) or the legacy SQLite file.

Also fix issue_prefix dot sanitization in init.go (TestEmbeddedInit/
prefix_dot_sanitized): when a prefix like "GPUPolynomials.jl" is used,
`issue_prefix` stored in the DB must have dots replaced with underscores
(matching DoltDatabase sanitization), otherwise issue IDs contain dots.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(ci): handle embedded-mode edge cases in upgrade smoke test

Three remaining failures after the CWD fix:

1. `storage.mode (not set)` treated as failure
   The `config get storage.mode` output includes the key name and "(not set)"
   when the config key doesn't exist. Embedded mode is the default and doesn't
   require an explicit setting, so any "not set" output should be accepted.
   Also accept the empty-string case that can arise with older config formats.

2. Embedded DB check too strict for v0.63.x
   v0.63.x was the first embedded-mode release; its init installed hooks and
   set beads.role correctly but may not have fully initialized the embeddeddolt/
   directory in CI due to early-release bugs. Changed the pre-upgrade check to
   verify `.beads/` directory exists (init ran) rather than the specific
   embeddeddolt/ subdirectory.

3. Create failures in old binaries treated as hard failures
   When an old binary cannot create issues (e.g. v0.63.x embedded init bug),
   the test now skips the data-migration and mutation checks with a `pass`
   (annotated as "skipped") rather than failing. The role-preservation and
   doctor checks still run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(ci): handle pre-embedded (server-mode) releases in smoke test scenario 3

v0.60.0-v0.62.0 used server mode and required an external Dolt server
to initialize. Without a running server in CI, their init installs hooks
but cannot create .beads/. The mode-preservation scenario was treating
this as a failure.

Change the pre-upgrade check in scenario 3 to skip gracefully when
.beads/ doesn't exist (old binary requires external server). The scenario
still runs candidate init and verifies the candidate defaults to embedded
mode — which is the meaningful test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 10:34:02 -07:00
..
hooks feat: Add post-push hook to auto-install bd CLI after git push 2025-10-14 17:23:43 -07:00
migration-test fix: remove unsupported stepping-stone migration paths (#3073) (#3110) 2026-04-07 12:56:56 -07:00
repro-dolt-hang /{cmd,internal,scripts}: use dsn helpers 2026-04-06 15:56:37 -07:00
bump-version.sh refactor: replace bump-version.sh with molecule pointer 2026-01-14 21:53:06 -08:00
check-doc-flags.sh fix(docs): purge stale bd sync/import/--branch refs + add CI doc validation (GH#2522) 2026-03-11 13:25:40 -07:00
check-versions.sh fix: gofmt formatting and remove stale hook template version checks 2026-03-01 14:41:32 -08:00
cross-version-smoke-test.sh fix: narrow cross-version smoke CI triggers and warn on high skip rate 2026-04-04 23:17:34 -07:00
docs.md docs: Add comprehensive documentation for version reporting changes 2025-12-13 10:04:01 +11:00
gen-winres.sh feat: embed Windows PE version info to reduce antivirus false positives (bd-t4u1) 2026-02-06 17:51:11 -08:00
generate-llms-full.sh feat(docs): version Docusaurus site and align llms-full with snapshots (#3033) 2026-04-06 21:12:54 -07:00
generate-newsletter.py Newsletter generator: automated narrative summaries of releases 2026-01-22 16:09:29 -08:00
generate-newsletter_README.md Newsletter generator: automated narrative summaries of releases 2026-01-22 16:09:29 -08:00
install-hooks.sh feat: Add post-push hook to auto-install bd CLI after git push 2025-10-14 17:23:43 -07:00
install.sh merge: resolve conflicts with main for PR #3146 2026-04-10 11:30:03 -07:00
migrate-jsonl-to-dolt.sh feat: add JSONL-to-Dolt migration script (GH#2276) 2026-03-02 22:05:38 -08:00
migrate-sqlite-to-current.sh docs: add cross-era migration instructions to upgrading guide (#3081) 2026-04-06 20:11:00 -07:00
README.md docs: remove stale daemon references from all documentation (GH#1982) 2026-02-22 17:57:53 -08:00
release.sh cleanup: remove remaining Gas Town terminology from help text, docs, and comments 2026-03-22 13:27:43 -07:00
sign-windows.sh feat: add Windows code signing infrastructure (bd-14v0) 2025-12-24 00:07:16 -08:00
test-cgo.sh docs+tooling: standardize CGO test workflow and ICU setup 2026-02-10 10:56:12 -05:00
test-git-remote.sh feat: add E2E test script for dolt git remote workflow (bd-v7ydv.2) 2026-02-12 10:20:08 -08:00
test.sh feat(testutil): reuse existing Dolt server via BEADS_DOLT_PORT (L1) 2026-02-24 16:16:56 -08:00
update-nix-vendorhash.sh feat: comprehensive NixOS support improvements (#1024) 2026-01-12 23:46:33 -08:00
update-versions.sh fix: gofmt formatting and remove stale hook template version checks 2026-03-01 14:41:32 -08:00
update-winget.sh docs: replace "git-backed" with "Dolt-powered", add git-free usage guide 2026-03-13 11:44:50 -07:00
upgrade-smoke-test.sh fix(ci): collapse multiline expression in cross-version-smoke workflow (#3189) 2026-04-11 10:34:02 -07:00
verify-cgo.sh fix: remove ICU runtime dependency from release binaries (#3066) 2026-04-07 09:48:44 -07:00

Beads Scripts

Utility scripts for maintaining the beads project.

release.sh (⭐ The Easy Button)

One-command release from version bump to local installation.

Usage

# Full release (does everything)
./scripts/release.sh 0.9.3

# Preview what would happen
./scripts/release.sh 0.9.3 --dry-run

What It Does

This master script automates the entire release process:

  1. ✅ Stops running Dolt servers (avoids version conflicts)
  2. ✅ Runs tests and linting
  3. ✅ Bumps version in all files
  4. ✅ Commits and pushes version bump
  5. ✅ Creates and pushes git tag
  6. ✅ Updates Homebrew formula
  7. ✅ Upgrades local brew installation
  8. ✅ Verifies everything works

After this script completes, your system is running the new version!

Examples

# Release version 0.9.3
./scripts/release.sh 0.9.3

# Preview a release (no changes made)
./scripts/release.sh 1.0.0 --dry-run

Prerequisites

  • Clean git working directory
  • All changes committed
  • golangci-lint installed
  • Homebrew installed (for local upgrade)
  • Push access to steveyegge/beads

Output

The script provides colorful, step-by-step progress output:

  • 🟨 Yellow: Current step
  • 🟩 Green: Step completed
  • 🟥 Red: Errors
  • 🟦 Blue: Section headers

What Happens Next

After the script finishes:

  • GitHub Actions builds binaries for all platforms (~5 minutes)
  • PyPI package is published automatically
  • Users can brew upgrade beads to get the new version
  • GitHub Release is created with binaries and changelog

bump-version.sh

Bumps the version number across all beads components in a single command.

Usage

# Show usage
./scripts/bump-version.sh

# Update versions (shows diff, no commit)
./scripts/bump-version.sh 0.9.3

# Update versions and auto-commit
./scripts/bump-version.sh 0.9.3 --commit

What It Does

Updates version in all these files:

  • cmd/bd/version.go - bd CLI version constant
  • claude-plugin/.claude-plugin/plugin.json - Plugin version
  • .claude-plugin/marketplace.json - Marketplace plugin version
  • integrations/beads-mcp/pyproject.toml - MCP server version
  • README.md - Alpha status version
  • PLUGIN.md - Version requirements

Features

  • Validates semantic versioning format (MAJOR.MINOR.PATCH)
  • Verifies all versions match after update
  • Shows git diff of changes
  • Auto-commits with standardized message (optional)
  • Cross-platform compatible (macOS and Linux)

Examples

# Bump to 0.9.3 and review changes
./scripts/bump-version.sh 0.9.3
# Review the diff, then manually commit

# Bump to 1.0.0 and auto-commit
./scripts/bump-version.sh 1.0.0 --commit
git push origin main

Why This Script Exists

Previously, version bumps only updated cmd/bd/version.go, leaving other components out of sync. This script ensures all version numbers stay consistent across the project.

Safety

  • Checks for uncommitted changes before proceeding
  • Refuses to auto-commit if there are existing uncommitted changes
  • Validates version format before making any changes
  • Verifies all versions match after update
  • Shows diff for review before commit

sign-windows.sh

Signs Windows executables with an Authenticode certificate using osslsigncode.

Usage

# Sign a Windows executable
./scripts/sign-windows.sh path/to/bd.exe

# Environment variables required for signing:
export WINDOWS_SIGNING_CERT_PFX_BASE64="<base64-encoded-pfx>"
export WINDOWS_SIGNING_CERT_PASSWORD="<certificate-password>"

What It Does

This script is called automatically by GoReleaser during the release process:

  1. Decodes the PFX certificate from base64
  2. Signs the Windows executable using osslsigncode
  3. Timestamps the signature using DigiCert's RFC3161 server
  4. Replaces the original binary with the signed version
  5. Verifies the signature was applied correctly

Prerequisites

  • osslsigncode installed (apt install osslsigncode or brew install osslsigncode)
  • EV code signing certificate exported as PFX file
  • GitHub secrets configured:
    • WINDOWS_SIGNING_CERT_PFX_BASE64 - base64-encoded PFX file
    • WINDOWS_SIGNING_CERT_PASSWORD - certificate password

Graceful Degradation

If the signing secrets are not configured:

  • The script prints a warning and exits successfully
  • GoReleaser continues without signing
  • The release proceeds with unsigned Windows binaries

This allows releases to work before a certificate is acquired.

Why This Script Exists

Windows code signing helps reduce antivirus false positives that affect Go binaries. Kaspersky and other AV software commonly flag unsigned Go executables as potentially malicious due to heuristic detection. See docs/ANTIVIRUS.md for details.


Future Scripts

Additional maintenance scripts may be added here as needed.