changelog generator & diff tool
stormlightlabs.github.io/git-storm/
changelog
changeset
markdown
golang
git
1# `storm` — Project Guide
2
3> Internal operations and release workflow
4
5This document outlines:
6
7- The release lifecycle
8- CLI integration into development workflows
9- Distribution setup for major package managers
10
11## Lifecycle
12
13### Local Development
14
15- Edit and test locally:
16
17 ```bash
18 go run ./cmd/storm unreleased add --type fixed --summary "Fix diff rendering"
19 go run ./cmd/storm unreleased list
20 go run ./cmd/storm unreleased review
21 ```
22
23- Each `.changes/*.md` entry represents one meaningful change.
24
25### 2. Preparing a Release
26
271. **Generate and review**
28
29 ```bash
30 storm generate v1.2.0 HEAD --interactive
31 ```
32
33 - Opens a Bubble Tea UI for categorization.
34 - Outputs candidate `.changes/` files if confirmed.
35
362. **Verify unreleased notes**
37
38 ```bash
39 storm unreleased list
40 ```
41
423. **Promote to changelog**
43
44 ```bash
45 storm release --version 1.3.0
46 ```
47
48 This:
49
50 - Merges `.changes/*.md` into `CHANGELOG.md`
51 - Inserts the date
52 - Clears `.changes/`
53 - (Optional) creates an annotated Git tag
54
554. **Commit and tag**
56
57 ```bash
58 git add CHANGELOG.md
59 git commit -m "Release 1.3.0"
60 git tag -a v1.3.0 -m "Release 1.3.0"
61 ```
62
63### Validation
64
65Before pushing:
66
67```bash
68go test ./...
69go run ./cmd/storm release --dry-run
70```
71
72Once satisfied:
73
74```bash
75git push origin main --tags
76```
77
78## CLI Integration in Workflows
79
80`storm` is meant to sit between `git log` and `CHANGELOG.md`.
81Use it at the end of development cycles or integrate it into CI pipelines.
82
83### Example integrations
84
85#### Local Workflow
86
87- Add a new `.changes` file per PR or major commit.
88- Review unreleased entries before each merge to `main`.
89- Run `storm release` when preparing a new version.
90
91#### Automated Release Job (CI)
92
93Example pseudo-pipeline (GitHub Actions / Drone / Woodpecker):
94
95```yaml
96steps:
97 - name: Compute next version
98 run: |
99 NEXT=$(storm bump --bump patch)
100 echo "::set-output name=version::$NEXT"
101 - name: Generate changelog
102 run: |
103 go install ./cmd/storm
104 storm release --version ${{ steps.bump.outputs.version }} --toolchain package.json
105 - name: Tag and push
106 run: |
107 git add CHANGELOG.md
108 git commit -m "Release ${{ steps.bump.outputs.version }}"
109 git tag -a v${{ steps.bump.outputs.version }} -m "Release ${{ steps.bump.outputs.version }}"
110 git push origin main --tags
111```
112
113#### Integration with other tools
114
115- **Taskfile / Justfile:** add `release` recipe calling `storm release`.
116- **GoReleaser:** run `storm release` in `before.hooks`.
117- **Custom TUI tools:** embed `internal/changeset` and `changelog` packages directly.
118
119## Packaging & Distribution
120
121### Homebrew (macOS / Linux)
122
123#### Create a tap repo
124
125Make a repo: `github.com/stormlightlabs/homebrew-tap`.
126
127#### Formula template (`storm.rb`)
128
129```ruby
130class Gostorm < Formula
131 desc "Git-aware changelog manager with TUI review"
132 homepage "https://github.com/stormlightlabs/git-storm"
133 version "1.3.0"
134 url "https://github.com/stormlightlabs/git-storm/archive/refs/tags/v1.3.0.tar.gz"
135 sha256 "<insert_sha256_here>"
136 license "MIT"
137
138 depends_on "go" => :build
139
140 def install
141 system "go", "build", *std_go_args, "./cmd/storm"
142 end
143
144 test do
145 system "#{bin}/storm", "--help"
146 end
147end
148```
149
150#### Update formula on each release
151
152Automate with `goreleaser`:
153
154```yaml
155brews:
156 - tap: stormlightlabs/homebrew-tap
157 name: storm
158 folder: Formula
159 commit_author:
160 name: Owais Jamil
161 email: owais@example.com
162```
163
164### Chocolatey (Windows)
165
166#### Create package skeleton
167
168```sh
169tools/
170 chocolateyinstall.ps1
171 VERIFICATION.txt
172storm.nuspec
173```
174
175#### `chocolateyinstall.ps1`
176
177```powershell
178$ErrorActionPreference = 'Stop'
179$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"
180$url = 'https://github.com/stormlightlabs/git-storm/releases/download/v1.3.0/storm_1.3.0_windows_amd64.zip'
181
182Install-ChocolateyZipPackage 'storm' $url $toolsDir
183```
184
185#### `.nuspec`
186
187```xml
188<package>
189 <metadata>
190 <id>storm</id>
191 <version>1.3.0</version>
192 <authors>Owais Jamil</authors>
193 <description>Git-aware changelog manager with TUI review</description>
194 <licenseUrl>https://opensource.org/licenses/MIT</licenseUrl>
195 <projectUrl>https://github.com/stormlightlabs/git-storm</projectUrl>
196 </metadata>
197</package>
198```
199
200#### Build & push
201
202```bash
203choco pack
204choco push storm.1.3.0.nupkg --source https://push.chocolatey.org/
205```
206
207### AUR
208
209#### Create PKGBUILD
210
211```bash
212pkgname=storm
213pkgver=1.3.0
214pkgrel=1
215pkgdesc="Git-aware changelog manager with TUI review"
216arch=('x86_64')
217url="https://github.com/stormlightlabs/git-storm"
218license=('MIT')
219depends=('git' 'go')
220source=("$url/archive/refs/tags/v${pkgver}.tar.gz")
221sha256sums=('SKIP')
222
223build() {
224 cd "$srcdir/storm-$pkgver"
225 go build -o storm ./cmd/storm
226}
227
228package() {
229 install -Dm755 storm "$pkgdir/usr/bin/storm"
230}
231```
232
233#### Submit
234
235Clone AUR repo:
236
237```bash
238git clone ssh://aur@aur.archlinux.org/storm.git
239cp PKGBUILD storm/
240cd storm
241makepkg --printsrcinfo > .SRCINFO
242git add .
243git commit -m "Add storm v1.3.0"
244git push
245```
246
247## Summary
248
249| Step | Action | Output |
250| ---- | ---------------------------------------------- | --------------------------- |
251| 1 | `storm generate v1.2.0 HEAD --interactive` | Draft unreleased notes |
252| 2 | `storm release --version 1.3.0` | Updated `CHANGELOG.md` |
253| 3 | `git tag -a v1.3.0` | Annotated release tag |
254| 4 | `goreleaser release --clean` | Builds + publishes binaries |
255| 5 | Update tap / choco / AUR formulas | Public distribution |
256
257## Maintenance Notes
258
259- Keep `.changes/` entries atomic and descriptive.
260- Avoid retroactive changelog edits outside releases.
261- Tag every release in Git with an exact semantic version (`vX.Y.Z`).
262- Ensure TUI remains optional (disable automatically in CI).
263- Treat changelog generation as a testable unit — not a side effect.