Skip to content

Commit 39340d0

Browse files
StarefossenCopilot
andcommitted
feat: homebrew tap + --version flag
- Add CloudNativeBergen/homebrew-tap auto-update job to release workflow Calculates SHA256 from build artifacts and commits updated formula - Add --version flag to CLI (required by brew formula test block) - Update README with brew install instructions and sponsor filter docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6417b13 commit 39340d0

3 files changed

Lines changed: 108 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ jobs:
101101
runs-on: ubuntu-latest
102102
permissions:
103103
contents: write
104+
outputs:
105+
tag: ${{ steps.version.outputs.tag }}
104106
steps:
105107
- uses: actions/download-artifact@v8
106108
with:
@@ -133,3 +135,85 @@ jobs:
133135
files: |
134136
artifacts/cnctl-*
135137
artifacts/SHA256SUMS
138+
139+
update-tap:
140+
name: Update Homebrew tap
141+
needs: [release]
142+
runs-on: ubuntu-latest
143+
steps:
144+
- uses: actions/download-artifact@v8
145+
with:
146+
path: artifacts
147+
merge-multiple: true
148+
149+
- name: Parse checksums
150+
id: sums
151+
run: |
152+
cd artifacts
153+
echo "mac_arm=$(sha256sum cnctl-aarch64-apple-darwin.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT"
154+
echo "mac_x86=$(sha256sum cnctl-x86_64-apple-darwin.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT"
155+
echo "linux_arm=$(sha256sum cnctl-aarch64-unknown-linux-gnu.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT"
156+
echo "linux_x86=$(sha256sum cnctl-x86_64-unknown-linux-gnu.tar.gz | awk '{print $1}')" >> "$GITHUB_OUTPUT"
157+
158+
- name: Checkout homebrew tap
159+
uses: actions/checkout@v6
160+
with:
161+
repository: CloudNativeBergen/homebrew-tap
162+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
163+
path: homebrew-tap
164+
165+
- name: Write formula
166+
env:
167+
VERSION: ${{ needs.release.outputs.tag }}
168+
MAC_ARM_SHA: ${{ steps.sums.outputs.mac_arm }}
169+
MAC_X86_SHA: ${{ steps.sums.outputs.mac_x86 }}
170+
LINUX_ARM_SHA: ${{ steps.sums.outputs.linux_arm }}
171+
LINUX_X86_SHA: ${{ steps.sums.outputs.linux_x86 }}
172+
run: |
173+
mkdir -p homebrew-tap/Formula
174+
cat > homebrew-tap/Formula/cnctl.rb << FORMULA
175+
class Cnctl < Formula
176+
desc "Organizer CLI for Cloud Native Days Norway"
177+
homepage "https://github.com/CloudNativeBergen/cnctl"
178+
version "${VERSION}"
179+
license "MIT"
180+
181+
on_macos do
182+
if Hardware::CPU.arm?
183+
url "https://github.com/CloudNativeBergen/cnctl/releases/download/${VERSION}/cnctl-aarch64-apple-darwin.tar.gz"
184+
sha256 "${MAC_ARM_SHA}"
185+
else
186+
url "https://github.com/CloudNativeBergen/cnctl/releases/download/${VERSION}/cnctl-x86_64-apple-darwin.tar.gz"
187+
sha256 "${MAC_X86_SHA}"
188+
end
189+
end
190+
191+
on_linux do
192+
if Hardware::CPU.arm?
193+
url "https://github.com/CloudNativeBergen/cnctl/releases/download/${VERSION}/cnctl-aarch64-unknown-linux-gnu.tar.gz"
194+
sha256 "${LINUX_ARM_SHA}"
195+
else
196+
url "https://github.com/CloudNativeBergen/cnctl/releases/download/${VERSION}/cnctl-x86_64-unknown-linux-gnu.tar.gz"
197+
sha256 "${LINUX_X86_SHA}"
198+
end
199+
end
200+
201+
def install
202+
bin.install "cnctl"
203+
end
204+
205+
test do
206+
assert_match version.to_s, shell_output("#{bin}/cnctl --version")
207+
end
208+
end
209+
FORMULA
210+
211+
- name: Commit and push
212+
run: |
213+
cd homebrew-tap
214+
git config user.name "github-actions[bot]"
215+
git config user.email "github-actions[bot]@users.noreply.github.com"
216+
git add Formula/cnctl.rb
217+
git diff --cached --quiet && echo "No changes" && exit 0
218+
git commit -m "chore: update cnctl to ${{ needs.release.outputs.tag }}"
219+
git push

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ The organizer CLI for [Cloud Native Days Norway](https://cloudnativedays.no). Re
1717

1818
## 📦 Installation
1919

20+
### Homebrew (macOS and Linux)
21+
22+
```sh
23+
brew tap CloudNativeBergen/tap
24+
brew install cnctl
25+
```
26+
2027
### Download a prebuilt binary
2128

2229
Grab the latest build for your platform from [GitHub Releases](https://github.com/CloudNativeBergen/cnctl/releases/latest):
@@ -142,11 +149,11 @@ cnctl admin proposals list --sort speaker --asc
142149

143150
**Available filters:**
144151

145-
| Flag | Values |
146-
|------|--------|
147-
| `--status` | `submitted`, `accepted`, `confirmed`, `waitlisted`, `rejected`, `withdrawn`, `draft`, `deleted` |
152+
| Flag | Values |
153+
| ---------- | -------------------------------------------------------------------------------------------------------------------------- |
154+
| `--status` | `submitted`, `accepted`, `confirmed`, `waitlisted`, `rejected`, `withdrawn`, `draft`, `deleted` |
148155
| `--format` | `lightning_10`, `presentation_20`, `presentation_25`, `presentation_40`, `presentation_45`, `workshop_120`, `workshop_240` |
149-
| `--sort` | `created`, `title`, `speaker`, `rating`, `reviews`, `status` |
156+
| `--sort` | `created`, `title`, `speaker`, `rating`, `reviews`, `status` |
150157

151158
**View a single proposal** with full details — speakers, topics, description, outline, and review scores:
152159

@@ -156,16 +163,16 @@ cnctl admin proposals get <proposal-id>
156163

157164
In **interactive mode**, selecting a proposal opens a scrollable detail view:
158165

159-
| Key | Action |
160-
|-----|--------|
161-
| `` / `k` | Scroll up |
162-
| `` / `j` | Scroll down |
163-
| `Ctrl+U` / `PgUp` | Half-page up |
164-
| `Ctrl+D` / `PgDn` | Half-page down |
165-
| `` / `h` | Previous proposal |
166-
| `` / `l` | Next proposal |
167-
| `r` | Start a review |
168-
| `q` / `Esc` | Back to list |
166+
| Key | Action |
167+
| ----------------- | ----------------- |
168+
| `` / `k` | Scroll up |
169+
| `` / `j` | Scroll down |
170+
| `Ctrl+U` / `PgUp` | Half-page up |
171+
| `Ctrl+D` / `PgDn` | Half-page down |
172+
| `` / `h` | Previous proposal |
173+
| `` / `l` | Next proposal |
174+
| `r` | Start a review |
175+
| `q` / `Esc` | Back to list |
169176

170177
**JSON output** for scripting and automation:
171178

@@ -207,8 +214,8 @@ cnctl admin sponsors list --status prospect,negotiating
207214
cnctl admin sponsors list --status closedWon
208215
```
209216

210-
| Flag | Values |
211-
|------|--------|
217+
| Flag | Values |
218+
| ---------- | ------------------------------------------------------------------- |
212219
| `--status` | `prospect`, `contacted`, `negotiating`, `closed-won`, `closed-lost` |
213220

214221
**JSON output:**

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use clap::{Parser, Subcommand};
33
use cnctl::commands;
44

55
#[derive(Parser)]
6-
#[command(name = "cnctl", about = "CLI for Cloud Native Days Norway")]
6+
#[command(name = "cnctl", about = "CLI for Cloud Native Days Norway", version)]
77
struct Cli {
88
#[command(subcommand)]
99
command: Command,

0 commit comments

Comments
 (0)