Skip to content

Commit 6511683

Browse files
authored
chore: protect main, Homebrew install path, and PR title checks (#11)
## Summary - Document and rely on GitHub rulesets already applied to `main` (PR-only, squash, required CI) - Add conventional PR title check, CODEOWNERS, governance docs - Make **Homebrew** the recommended macOS install + upgrade path (`brew upgrade` / `brew autoupdate`) - Release workflow bumps `Formula/microbridge.rb` via PR after each `v*` tag ## Test plan - [x] Rulesets created on repo (`Protect main`, `Protect release tags`) - [ ] CI green on this PR (`rust`, `ui`, `conventional title`) - [ ] Squash-merge into `main` Made with [Cursor](https://cursor.com) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added automated pull request title validation. * Automated Homebrew formula updates after releases. * Added detailed governance and release process documentation. * **Documentation** * Reworked installation guidance for macOS, Linux, source builds, and release binaries. * Expanded contribution guidelines and updated README installation instructions. * **Release Improvements** * Added macOS release installation instructions. * Updated Homebrew metadata and installation caveats. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 67f0daa commit 6511683

10 files changed

Lines changed: 288 additions & 84 deletions

File tree

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Default owners for review routing (optional reviews; PRs still required on main).
2+
* @DevVig
3+
4+
/crates/ @DevVig
5+
/apps/microbridge-ui/ @DevVig
6+
/adapters/ @DevVig
7+
/Formula/ @DevVig
8+
/.github/ @DevVig

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ jobs:
4141
cache-dependency-path: apps/microbridge-ui/package-lock.json
4242
- run: npm ci
4343
- run: npm run build
44+
45+
# Keep required-check names stable for the main branch ruleset.
46+
# Job names above are what GitHub shows as status contexts.

.github/workflows/pr-title.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PR title
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
permissions:
8+
pull-requests: read
9+
10+
jobs:
11+
lint:
12+
name: conventional title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
types: |
20+
feat
21+
fix
22+
docs
23+
style
24+
refactor
25+
perf
26+
test
27+
build
28+
ci
29+
chore
30+
adapter
31+
revert
32+
requireScope: false
33+
subjectPattern: .+
34+
wip: true

.github/workflows/release.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
pull-requests: write
1011

1112
jobs:
1213
build:
@@ -18,7 +19,7 @@ jobs:
1819
include:
1920
- os: macos-latest
2021
target: aarch64-apple-darwin
21-
- os: macos-13
22+
- os: macos-latest
2223
target: x86_64-apple-darwin
2324
- os: ubuntu-latest
2425
target: x86_64-unknown-linux-gnu
@@ -29,8 +30,7 @@ jobs:
2930
targets: ${{ matrix.target }}
3031
- uses: Swatinem/rust-cache@v2
3132
- name: Build
32-
run: |
33-
cargo build --release -p microbridged -p microbridgectl --target ${{ matrix.target }}
33+
run: cargo build --release -p microbridged -p microbridgectl --target ${{ matrix.target }}
3434
- name: Package
3535
run: |
3636
STAGE=microbridge-${{ github.ref_name }}-${{ matrix.target }}
@@ -64,10 +64,46 @@ jobs:
6464
generate_release_notes: true
6565
files: release-assets/*
6666
body: |
67-
## Install
67+
## Install (macOS)
6868
6969
```sh
70-
./scripts/install-from-release.sh ${{ github.ref_name }}
70+
brew tap DevVig/microbridge https://github.com/DevVig/microbridge
71+
brew install microbridge
72+
brew services start microbridge
7173
```
7274
73-
Or from source: see [INSTALL.md](INSTALL.md).
75+
Upgrade later: `brew update && brew upgrade microbridge`
76+
77+
Binary archive: `./scripts/install-from-release.sh ${{ github.ref_name }}`
78+
79+
Full guide: [INSTALL.md](INSTALL.md).
80+
81+
bump-formula:
82+
name: bump Homebrew formula
83+
needs: publish
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v5
87+
with:
88+
ref: main
89+
- name: Bump Formula url + sha256
90+
env:
91+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
run: |
93+
chmod +x scripts/bump-formula.sh
94+
./scripts/bump-formula.sh "${{ github.ref_name }}"
95+
- name: Open PR
96+
uses: peter-evans/create-pull-request@v7
97+
with:
98+
token: ${{ secrets.GITHUB_TOKEN }}
99+
commit-message: "chore(brew): bump formula to ${{ github.ref_name }}"
100+
title: "chore(brew): bump formula to ${{ github.ref_name }}"
101+
body: |
102+
Auto-bump `Formula/microbridge.rb` after release `${{ github.ref_name }}`.
103+
104+
After merge, users get the new version via:
105+
```sh
106+
brew update && brew upgrade microbridge
107+
```
108+
branch: chore/brew-${{ github.ref_name }}
109+
delete-branch: true

CONTRIBUTING.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,18 @@ Assets are attached to the GitHub Release; users can run
5353

5454
## Commits and PRs
5555

56-
- Conventional commits (`feat:`, `fix:`, `docs:`, `adapter:` for adapter
57-
work).
56+
`main` is protected — **no direct pushes**. Open a PR; squash-merge only.
57+
58+
- PR titles must be Conventional Commits (`feat:`, `fix:`, `docs:`,
59+
`adapter:`, …) — enforced by CI (`PR title` workflow).
60+
- Required checks: `rust (ubuntu-latest)`, `rust (macos-latest)`, `ui`.
61+
- Resolve review threads before merge.
5862
- One logical change per PR; small PRs merge fast here.
5963
- PRs must say how they were tested — "ran the reference adapter against the
6064
daemon and watched the frames" is a fine answer at this stage.
6165

66+
See [docs/governance.md](docs/governance.md).
67+
6268
## Reporting security issues
6369

6470
Privately, please — see [SECURITY.md](SECURITY.md).

Formula/microbridge.rb

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
# Homebrew formula (build-from-source until a tap/bottle is published).
1+
# typed: false
2+
# frozen_string_literal: true
3+
4+
# Homebrew formula for Microbridge (source build — fast enough for alpha).
25
#
3-
# brew install --build-from-source ./Formula/microbridge.rb
6+
# brew tap DevVig/microbridge https://github.com/DevVig/microbridge
7+
# brew install microbridge
48
# brew services start microbridge
59
#
10+
# Upgrade (auto-update path):
11+
# brew update && brew upgrade microbridge
12+
# brew autoupdate start --upgrade --cleanup # optional background updates
13+
#
614
class Microbridge < Formula
715
desc "Open-source control plane for the Codex Micro"
816
homepage "https://github.com/DevVig/microbridge"
17+
url "https://github.com/DevVig/microbridge/archive/refs/tags/v0.0.1.tar.gz"
18+
sha256 "f171c275890add016045b0bbde54330f104b6d5db3a9d16c8d366cd5fcdde599"
919
license any_of: ["MIT", "Apache-2.0"]
1020
head "https://github.com/DevVig/microbridge.git", branch: "main"
1121

@@ -28,9 +38,10 @@ def install
2838

2939
def caveats
3040
<<~EOS
31-
Config and socket live in ~/.microbridge/
32-
Check the bus with: microbridgectl status
33-
Full install notes: #{doc}/INSTALL.md (or INSTALL.md in the repo)
41+
Config and socket: ~/.microbridge/
42+
Status: microbridgectl status
43+
Upgrade: brew update && brew upgrade microbridge
44+
Background updates: brew autoupdate start --upgrade --cleanup
3445
EOS
3546
end
3647

INSTALL.md

Lines changed: 73 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,122 @@
11
# Installing Microbridge
22

33
Microbridge is a local daemon plus an optional companion UI. There is **no
4-
network** and **no cloud account** — install puts binaries on your machine and
5-
(on macOS) a per-user launchd agent.
4+
cloud account** — install puts binaries on your machine and runs a user-level
5+
service.
66

7-
## Requirements
8-
9-
| Piece | Need |
10-
|---|---|
11-
| Daemon | Rust stable (`rustup`), macOS 13+ or Linux |
12-
| Companion UI (optional) | Node ≥ 20; full `.app` also needs Xcode CLT |
13-
| Hardware LEDs | Codex Micro over USB (HID packing still landing — mock works without hardware) |
7+
## Recommended on macOS: Homebrew (with updates)
148

15-
## Quick install (macOS, from source)
9+
This is the easy path. You do **not** need to clone the repo. Homebrew owns
10+
install, upgrades, and the launchd service.
1611

1712
```sh
18-
git clone https://github.com/DevVig/microbridge.git
19-
cd microbridge
20-
./scripts/install.sh
13+
brew tap DevVig/microbridge https://github.com/DevVig/microbridge
14+
brew install microbridge
15+
brew services start microbridge
16+
microbridgectl status
2117
```
2218

23-
This will:
24-
25-
1. `cargo build --release` for `microbridged` and `microbridgectl`
26-
2. Install them to `~/.local/bin` (override with `MICROBRIDGE_BIN=…`)
27-
3. Ensure `~/.local/bin` is on your PATH (prints a hint if not)
28-
4. Install and start the launchd agent `ai.microbridge.daemon`
29-
5. Write config defaults under `~/.microbridge/`
30-
31-
Verify:
19+
### Updates
3220

3321
```sh
34-
microbridgectl status
35-
# or:
36-
tail -f ~/.microbridge/daemon.log
22+
brew update && brew upgrade microbridge
23+
brew services restart microbridge
3724
```
3825

39-
### Optional companion UI
26+
Optional **background** upgrades (Homebrew’s autoupdate):
4027

4128
```sh
42-
./scripts/install.sh --with-ui
43-
# web preview during development:
44-
cd apps/microbridge-ui && npm install && npm run dev
29+
brew autoupdate start --upgrade --cleanup --immediate
30+
# later: brew autoupdate status / brew autoupdate stop
4531
```
4632

47-
`--with-ui` installs frontend deps and, when Tauri/Xcode tooling is available,
48-
attempts `npm run tauri build`. You can always run the Vite UI against a live
49-
daemon without bundling an `.app`.
33+
Private tap note: if the GitHub repo is private, authenticate once
34+
(`gh auth login` or a `HOMEBREW_GITHUB_API_TOKEN`) so `brew` can fetch the
35+
tarball.
5036

51-
## Linux (from source)
37+
Uninstall:
5238

5339
```sh
54-
./scripts/install.sh --no-launchd
55-
# run in the foreground, or add your own systemd --user unit:
56-
microbridged
40+
brew services stop microbridge
41+
brew uninstall microbridge
42+
# optional: brew untap DevVig/microbridge
5743
```
5844

59-
A sample user unit is in [`scripts/microbridge.service`](scripts/microbridge.service).
45+
Governance / why this path: [docs/governance.md](docs/governance.md).
6046

61-
## Homebrew (skeleton)
47+
---
48+
49+
## Requirements
50+
51+
| Piece | Need |
52+
|---|---|
53+
| Daemon (Homebrew) | Homebrew; Rust pulled in as a build dependency |
54+
| Daemon (from source) | Rust stable (`rustup`), macOS 13+ or Linux |
55+
| Companion UI (optional) | Node ≥ 20; full `.app` also needs Xcode CLT |
56+
| Hardware LEDs | Codex Micro over USB (HID packing still landing — mock works without hardware) |
57+
58+
## From source (developers)
6259

6360
```sh
64-
brew install --build-from-source ./Formula/microbridge.rb
65-
brew services start microbridge # when using the formula's service block
61+
git clone https://github.com/DevVig/microbridge.git
62+
cd microbridge
63+
./scripts/install.sh # macOS: binaries + launchd
64+
# ./scripts/install.sh --with-ui
65+
# ./scripts/install-linux-systemd.sh
66+
microbridgectl status
6667
```
6768

68-
A published tap/bottle is not available yet — use `./scripts/install.sh` for
69-
day-to-day installs.
70-
71-
## Install from a GitHub Release
69+
Uninstall: `./scripts/uninstall.sh` (add `--purge` to remove `~/.microbridge`).
7270

73-
When a `v*` tag is pushed, CI attaches platform archives. Then:
71+
### Optional companion UI
7472

7573
```sh
76-
./scripts/install-from-release.sh v0.0.1
77-
# or latest:
78-
./scripts/install-from-release.sh
74+
./scripts/install.sh --with-ui
75+
# or during development:
76+
cd apps/microbridge-ui && npm install && npm run dev
7977
```
8078

81-
## Uninstall
79+
## Linux
8280

8381
```sh
84-
./scripts/uninstall.sh
82+
./scripts/install-linux-systemd.sh
83+
# or:
84+
./scripts/install.sh --no-launchd && microbridged
8585
```
8686

87-
Removes the launchd agent, binaries from `MICROBRIDGE_BIN` / `~/.local/bin`,
88-
and optionally (`--purge`) `~/.microbridge/` (config, socket, logs).
87+
Sample unit: [`scripts/microbridge.service`](scripts/microbridge.service).
88+
89+
## Install from a GitHub Release (binaries)
90+
91+
When a `v*` tag is published, CI attaches platform archives:
92+
93+
```sh
94+
./scripts/install-from-release.sh # latest
95+
./scripts/install-from-release.sh v0.0.1
96+
```
8997

9098
## Layout after install
9199

92100
| Path | Purpose |
93101
|---|---|
94-
| `~/.local/bin/microbridged` | Daemon |
95-
| `~/.local/bin/microbridgectl` | CLI |
96-
| `~/Library/LaunchAgents/ai.microbridge.daemon.plist` | macOS autostart |
102+
| `$(brew --prefix)/bin/microbridged` | Daemon (Homebrew) |
103+
| `~/.local/bin/microbridged` | Daemon (source install script) |
97104
| `~/.microbridge/microbridged.sock` | Local NDJSON socket |
98105
| `~/.microbridge/config.toml` | Key source, lighting, appearance |
99-
| `~/.microbridge/daemon.log` | launchd stdout/stderr |
106+
| `~/.microbridge/daemon.log` | launchd / service logs |
100107

101108
## Troubleshooting
102109

103-
**`microbridgectl: connect …`** — daemon not running. On macOS:
104-
`launchctl kickstart -k gui/$(id -u)/ai.microbridge.daemon`.
110+
**`microbridgectl: connect …`** — daemon not running.
111+
112+
```sh
113+
brew services restart microbridge
114+
# or:
115+
launchctl kickstart -k "gui/$(id -u)/ai.microbridge.daemon"
116+
```
105117

106118
**LEDs stay dark** — HID packing is still best-effort; ChatGPT desktop may
107-
also own the device. Pause that app or use Settings → Pause LEDs while testing
108-
the mock path (`microbridgectl status` still works).
119+
also own the device.
109120

110-
**PATH**add `export PATH="$HOME/.local/bin:$PATH"` to your shell rc if
111-
`microbridgectl` is not found.
121+
**Homebrew can’t fetch (private repo)**`gh auth login`, or set
122+
`HOMEBREW_GITHUB_API_TOKEN` to a PAT with `repo` scope.

0 commit comments

Comments
 (0)