Skip to content

Commit 5fbe18d

Browse files
committed
docs: add release flow documentation
1 parent 6c05c73 commit 5fbe18d

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

docs/release-flow.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Release Flow
2+
3+
## Overview
4+
5+
Releases are fully automated via GitHub Actions. Pushing a version tag triggers the workflow.
6+
7+
## How to release
8+
9+
**1. Update version in three places:**
10+
11+
```bash
12+
# CMakeLists.txt
13+
project(HeadsetStatus VERSION 1.2.3 LANGUAGES CXX)
14+
15+
# PKGBUILD
16+
pkgver=1.2.3
17+
18+
# CHANGELOG.md — add new section at the top:
19+
## [1.2.3] - YYYY-MM-DD
20+
### Added/Changed/Fixed
21+
- ...
22+
```
23+
24+
**2. Commit the version bump:**
25+
26+
```bash
27+
git add CMakeLists.txt PKGBUILD CHANGELOG.md
28+
git commit -m "bump version to 1.2.3"
29+
```
30+
31+
**3. Push tag:**
32+
33+
```bash
34+
git tag v1.2.3
35+
git push origin main
36+
git push origin v1.2.3
37+
```
38+
39+
That's it. The rest is automatic.
40+
41+
---
42+
43+
## What the release workflow does
44+
45+
Triggered by any tag matching `v*.*.*`:
46+
47+
1. Installs `cmake`, `qt6-base-dev`, `libgl-dev`, `libdbus-1-dev`, `upx`
48+
2. Builds binary with `cmake -DCMAKE_BUILD_TYPE=Release` (LTO, -Os, strip-all, UPX)
49+
3. Downloads GitHub source tarball with retry (5 attempts, 10s between)
50+
4. Computes sha256sum and patches `PKGBUILD` — exits with error if substitution fails
51+
5. Extracts the `## [1.2.3]` section from `CHANGELOG.md` as release notes (fallback if missing)
52+
6. Creates GitHub Release with:
53+
- `HeadsetStatus` — compiled binary
54+
- `PKGBUILD` — updated with correct sha256sum
55+
56+
---
57+
58+
## Workflows
59+
60+
| File | Trigger | Purpose |
61+
|---|---|---|
62+
| `.github/workflows/ci.yml` | push to `main`, PRs | Validates the build compiles |
63+
| `.github/workflows/release.yml` | push tag `v*.*.*` | Creates GitHub Release |
64+
65+
Both use `actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683` (v4.2.2, SHA-pinned).
66+
67+
---
68+
69+
## Important notes
70+
71+
- **CHANGELOG.md must have the version section** before pushing the tag, otherwise release notes say `"No changelog entry found for X.Y.Z."`
72+
- **sha256sums in PKGBUILD** is patched automatically by the workflow — do not update it manually before tagging
73+
- **Remote must be SSH** (`git@github.com:mewset/headsetstatus.git`) — HTTPS OAuth lacks the `workflow` scope needed to push `.github/workflows/` files
74+
75+
To verify the remote is SSH:
76+
```bash
77+
git remote -v
78+
# Should show: git@github.com:mewset/headsetstatus.git
79+
```
80+
81+
To fix if it's HTTPS:
82+
```bash
83+
git remote set-url origin git@github.com:mewset/headsetstatus.git
84+
```
85+
86+
---
87+
88+
## Deleting a release
89+
90+
```bash
91+
gh release delete v1.2.3 --yes
92+
git push origin --delete v1.2.3
93+
git tag -d v1.2.3
94+
```

0 commit comments

Comments
 (0)