Skip to content

Commit 886dcf2

Browse files
feat(automations): add version bump prep tool
Adds automations/bump-version.ts, a Bun script that automates the file-editing half of every WOML release: - bumps 4 package.json + 2 Cargo.toml + 1 Dockerfile in one pass - bumps 3 identity scripts + 3 test fixtures + 1 Rust test - regenerates Cargo.lock via cargo update --workspace - runs the full release validation suite (15 tests + 3 verifiers + typecheck), fail-fast - prints git diff --stat summary - prints the suggested git commit / tag / push / npm publish commands for the human to run The tool is prep-only. It deliberately does NOT commit, tag, push, or publish. Those are irreversible and stay as deliberate human choices. It supports --dry-run for safe preview and auto-detects the repo root by walking up looking for the woml-repository package.json.
1 parent acb8130 commit 886dcf2

2 files changed

Lines changed: 464 additions & 0 deletions

File tree

automations/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Maintainer automations
2+
3+
This folder contains scripts the maintainers run to build, version, and ship WOML. They are **not** user-facing examples — for those, see `examples/` at the repo root.
4+
5+
## `bump-version.ts`
6+
7+
A prep tool that edits every place in the repo where the WOML version lives, regenerates the Cargo lockfile, and runs the full release validation suite. After it finishes, it prints the exact `git commit`, `git tag`, and `git push` commands the human should run.
8+
9+
### Toolchain
10+
11+
Requires the same toolchain as the rest of the project: `bun`, `git`, `cargo`, and `npm`. All are already hard dependencies.
12+
13+
### Usage
14+
15+
```bash
16+
# From anywhere inside the repo
17+
bun automations/bump-version.ts --from 1.0.4 --to 1.0.5
18+
19+
# Preview what would change without editing anything
20+
bun automations/bump-version.ts --from 1.0.4 --to 1.0.5 --dry-run
21+
```
22+
23+
The tool auto-detects the repository root by walking up from the current directory looking for the `woml-repository` `package.json`, so it works from any subdirectory.
24+
25+
### What it edits
26+
27+
The full list of files the tool knows how to bump:
28+
29+
- `woml-cli/package.json` — public `woml-cli`
30+
- `woml/package.json` — private `@woml/compiler`
31+
- `package.json` (repo root) — private `woml-repository`
32+
- `woml-vscode/package.json` — private `woml-language`
33+
- `core/woml-engine/Cargo.toml` — package version
34+
- `core/woml-native/Cargo.toml` — package version + `woml-engine` dependency version
35+
- `examples/production/deployment/Dockerfile``ARG WOML_VERSION=`
36+
- `core/Cargo.lock` — regenerated via `cargo update --workspace`
37+
- `woml-cli/scripts/release-package.ts` — identity check + log line
38+
- `woml-cli/scripts/verify-production-release.ts` — identity check
39+
- `woml-cli/scripts/verify-final-release-review.ts` — identity check
40+
- `woml-cli/tests/release-identity.test.ts` — fixtures + test name
41+
- `woml-cli/tests/release-family.test.ts` — fixtures
42+
- `woml-cli/tests/native-platform-release.test.ts` — fixture
43+
- `core/woml-native/tests/separation.rs` — Rust string literal
44+
45+
### What it does **not** do
46+
47+
The tool is prep-only. It deliberately does not:
48+
49+
- Run `git commit`
50+
- Run `git tag`
51+
- Run `git push`
52+
- Run `npm publish`
53+
54+
After the tool finishes successfully, it prints the exact commands the human should run. This is a safety net: every irreversible action (commit, tag, push, publish) remains a deliberate human choice.
55+
56+
### When to update this tool
57+
58+
If a new manifest is added to the project (a new `package.json`, `Cargo.toml`, hardcoded version string), the maintainer must add it to `bump-version.ts` so the next bump catches it. The `git diff --stat` summary at the end of each run makes any missing bump visible — if the expected files don't appear in the diff, the tool needs updating.
59+
60+
### Validation it runs
61+
62+
After all edits, the tool runs:
63+
64+
1. `bun test tests/release-identity.test.ts tests/native-platform-release.test.ts --max-concurrency=1`
65+
2. `bun test tests/release-automation.test.ts tests/release-artifact.test.ts tests/release-family.test.ts --max-concurrency=1`
66+
3. `bun scripts/verify-native-platform-release.ts`
67+
4. `bun scripts/verify-documentation.ts`
68+
5. `bun run typecheck`
69+
70+
If any step fails, the tool halts and prints the failing step's stderr. No edits are rolled back — the human can fix the issue and re-run the tool; it's idempotent for the version-string edits (replace is a no-op if the new value already matches).

0 commit comments

Comments
 (0)