1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env bash
#
# Usage: s/version++ [patch|minor|major] (default: patch)
#
# The one release action. In order: bumps the version in Cargo.toml,
# regenerates CHANGELOG.md (git-cliff), commits the release, tags it, and
# pushes main + the tag. The pushed tag triggers the cargo-dist release
# workflow (prebuilt binaries + GitHub Release) and the crates.io publish.
#
# Commit your feature work FIRST, with a conventional-commit message
# (`feat(...)`, `fix:`, ...). git-cliff reads *committed* history, so anything
# uncommitted won't appear in the new CHANGELOG.md section; this script makes
# only the release commit.
#
# Note on tagging (divergence from ~/code/house-style/distribution.md):
# the house standard is s/version++ commits+pushes and a CI auto-tag.yml
# creates the tag via `workflow_call`. That needs a workflow_call-able
# release workflow. dsc's release.yml is cargo-dist-generated and is
# *tag-driven* (it reads the version from the pushed tag ref and only
# triggers on `push: tags`), and there's a second tag-triggered workflow
# (publish-crates.yml). So the cascade doesn't fit here without a PAT
# secret to push the tag from CI. Until then we tag locally, AFTER the
# commit (fixing the tag-before-commit hazard the standard warns about);
# with no auto-tag there's no duplicate-tag race.
bump=""
# Release from main only.
branch=""
if ; then
fi
# The release commit must contain only the bump + changelog, so the tree must
# be clean (feature work already committed).
if ! || ! ; then
fi
if ! ; then
fi
# Pre-release gate: mirror the CI checks (.github/workflows/ci.yml) locally so we
# never cut and push a release that CI would then reject *after* the tag has
# already triggered the irreversible release. Runs before anything is modified,
# so a failure aborts cleanly.
#
# The full `cargo test` (not just --lib) is the point: integration tests in
# tests/ shell out to the binary and only fail at runtime, so `--lib` misses
# them - which is how a broken flag test once slipped past into CI. Pointing
# TEST_DSC_CONFIG at an unreadable path makes the live-forum e2e tests skip
# (they gate on that config) exactly as they do in CI, while the offline
# integration tests still run - so the gate never touches a live forum.
TEST_DSC_CONFIG=/dev/null/disable-e2e
version=""
tag="v"
if ; then
fi
# Render the in-progress changelog section under the new tag + date.
# Sync Cargo.lock's own version to the bump (workspace members only, external
# deps untouched), then commit the release and tag it AFTER the commit (so the
# tag contains the bump).
||