Commit c482309
authored
KAN-196/redesign-release-workflow-defer-version-bump-to-master-merge (#163)
* fix: defer version bump to master merge
The previous workflow bumped version on every develop merge, causing
desync between Cargo.toml version and crates.io. Version 0.2.1 was
bumped on develop but never published.
Move version bumping into release.yml so bump, changelog, publish,
and tag all happen atomically on master merge:
- Delete aggregate-changesets.yml (no more auto-bump on develop)
- Rewrite release.yml to run bump-version.sh on master merge
- Replace ci.yml version-check with changeset-check for master PRs
- Delete scripts/aggregate-changelog.sh (redundant with bump-version.sh)
- Revert version 0.2.1 -> 0.2.0 to sync with master/crates.io
- Remove broken 0.2.1 CHANGELOG entry
KAN-196
* fix: exclude README.md from changeset detection in bump-version.sh
The glob `ls -A .changeset/*.md` matched README.md, causing the script
to think changesets exist when only the README is present. The for loop
also lacked a skip guard, so README.md would be parsed as a changeset
producing garbage changelog entries.
Replace ls glob with find that excludes README.md, and add a basename
check in the iteration loop.
* refactor: extract changelog aggregation into standalone script
bump-version.sh was handling version bumping, changelog aggregation,
changeset cleanup, and git commit in a single script. Split these
concerns:
- bump-version.sh: only bumps versions in Cargo.toml files and runs
cargo update
- aggregate-changelog.sh: reads changesets, prepends entries to
CHANGELOG.md with PR link, then deletes processed changeset files
Also fix fragile bump-type parsing by using sed to properly extract
the bump field from within frontmatter boundaries instead of grep -A1
which only matched immediately after the first ---.
* fix: reorder release workflow to validate before push
Previously the release workflow pushed the version bump commit to master
before running validation. If validation failed, master would have a
bumped version with no corresponding crates.io publish.
Reorder steps: bump -> aggregate changelog -> commit -> get version ->
validate -> push -> publish. Validation now runs locally before anything
is pushed.
Also split the workflow into separate visible steps for bump, changelog,
and commit. And handle merge conflicts in the develop sync step with a
warning instead of failing the entire release.
* fix: use robust frontmatter parsing in changeset-check
The grep -A1 approach only found the bump field if it appeared on the
line immediately after ---. Use sed to extract from within the full
frontmatter block, and fall back to "unknown" if parsing fails.
* chore: wire all scripts into nix dev shell
Add aggregate-changelog as a writeShellApplication in flake.nix and
pass all script packages (changeset, aggregate-changelog, bump-version,
publish-crates, validate-release) into shell.nix from the flake.
Remove the duplicate writeShellScriptBin changeset definition from
shell.nix — it now receives the flake's writeShellApplication version
like the other scripts. Defaults to null so standalone nix-shell still
works.
Update CI workflows to use `nix develop --command <name>` consistently
instead of `bash scripts/...` or `nix run .#...`.
* fix: quote variable in parameter expansion to satisfy shellcheck SC2295
writeShellApplication runs shellcheck, which flags unquoted variables
inside parameter expansion patterns.
* fix: address PR review findings for release workflow
- Make changeset-check block master PRs without changesets, with
[hotfix] PR title bypass
- Add ordering comment for bump-version/aggregate-changelog dependency
- Consolidate duplicate version read into single release step
- Reinstate cleanup trap in aggregate-changelog.sh
- Filter shell.nix scripts individually instead of all-or-nothing guard
* chore: add changeset
* fix: address review findings for release workflow scripts
- Strip leading "- " from changeset descriptions before prepending it
in aggregate-changelog to prevent double-dash entries
- Remove dead GITHUB_OUTPUT write from bump-version.sh (release.yml
reads version from Cargo.toml directly)
- Move PR title from inline ${{ }} interpolation to env block in
changeset-check to prevent shell injection
* fix: normalize changelog bullet prefix per-line in aggregate-changelog1 parent c5a0b51 commit c482309
File tree
12 files changed
+157
-238
lines changed- .changeset
- .github/workflows
- scripts
12 files changed
+157
-238
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | 133 | | |
136 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
154 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
| |||
167 | 176 | | |
168 | 177 | | |
169 | 178 | | |
170 | | - | |
| 179 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | | - | |
24 | | - | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
45 | 40 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
49 | 44 | | |
50 | 45 | | |
51 | 46 | | |
52 | | - | |
| 47 | + | |
53 | 48 | | |
54 | 49 | | |
55 | 50 | | |
56 | 51 | | |
57 | 52 | | |
58 | 53 | | |
59 | | - | |
| 54 | + | |
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
64 | 59 | | |
65 | 60 | | |
66 | 61 | | |
67 | | - | |
| 62 | + | |
68 | 63 | | |
69 | 64 | | |
70 | 65 | | |
71 | 66 | | |
72 | 67 | | |
73 | | - | |
74 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
75 | 72 | | |
76 | | - | |
| 73 | + | |
77 | 74 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | | - | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | | - | |
| 91 | + | |
89 | 92 | | |
90 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
91 | 101 | | |
92 | 102 | | |
93 | | - | |
| 103 | + | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
97 | | - | |
| 107 | + | |
98 | 108 | | |
99 | | - | |
| 109 | + | |
100 | 110 | | |
101 | 111 | | |
102 | | - | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
106 | | - | |
107 | | - | |
| 116 | + | |
| 117 | + | |
108 | 118 | | |
109 | 119 | | |
110 | | - | |
| 120 | + | |
111 | 121 | | |
112 | 122 | | |
113 | | - | |
| 123 | + | |
114 | 124 | | |
115 | 125 | | |
116 | | - | |
117 | | - | |
| 126 | + | |
| 127 | + | |
118 | 128 | | |
119 | 129 | | |
120 | 130 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
133 | 138 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 1 | | |
23 | 2 | | |
24 | 3 | | |
| |||
0 commit comments