Skip to content

Commit 1eac72b

Browse files
committed
add Homebrew support; introduce version command and dynamic versioning integration
1 parent 5493f10 commit 1eac72b

8 files changed

Lines changed: 131 additions & 4 deletions

File tree

.github/workflows/homebrew.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bump Homebrew formula
2+
3+
# Updates the `ronyup` formula in clubpay/homebrew-tap whenever a new
4+
# `ronyup/vX.Y.Z` tag is pushed (created by scripts/bump-workspace.sh).
5+
#
6+
# Requires a repository secret HOMEBREW_TAP_TOKEN: a PAT (or fine-grained token)
7+
# with `contents:write` on clubpay/homebrew-tap. The default GITHUB_TOKEN cannot
8+
# push to another repository.
9+
10+
on:
11+
push:
12+
tags:
13+
- "ronyup/v*"
14+
workflow_dispatch:
15+
inputs:
16+
tag:
17+
description: "ronyup tag to publish (e.g. ronyup/v0.4.7)"
18+
required: true
19+
20+
jobs:
21+
bump:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Resolve tag and version
25+
id: meta
26+
run: |
27+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
28+
TAG="${{ github.event.inputs.tag }}"
29+
else
30+
TAG="${GITHUB_REF#refs/tags/}"
31+
fi
32+
# TAG looks like "ronyup/v0.4.7"; VERSION is "0.4.7".
33+
VERSION="${TAG##*/v}"
34+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
35+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
36+
37+
- name: Compute source tarball checksum
38+
id: sha
39+
run: |
40+
URL="https://github.com/${{ github.repository }}/archive/refs/tags/${{ steps.meta.outputs.tag }}.tar.gz"
41+
echo "url=$URL" >> "$GITHUB_OUTPUT"
42+
curl -fsSL "$URL" -o source.tar.gz
43+
SHA="$(sha256sum source.tar.gz | cut -d' ' -f1)"
44+
echo "sha256=$SHA" >> "$GITHUB_OUTPUT"
45+
46+
- name: Checkout tap
47+
uses: actions/checkout@v6
48+
with:
49+
repository: clubpay/homebrew-tap
50+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
51+
path: tap
52+
53+
- name: Update formula
54+
run: |
55+
FORMULA="tap/Formula/ronyup.rb"
56+
sed -i -E "s|^ url \".*\"| url \"${{ steps.sha.outputs.url }}\"|" "$FORMULA"
57+
sed -i -E "s|^ sha256 \".*\"| sha256 \"${{ steps.sha.outputs.sha256 }}\"|" "$FORMULA"
58+
echo "----- updated formula -----"
59+
cat "$FORMULA"
60+
61+
- name: Commit and push
62+
run: |
63+
cd tap
64+
if git diff --quiet; then
65+
echo "Formula already up to date; nothing to do."
66+
exit 0
67+
fi
68+
git config user.name "github-actions[bot]"
69+
git config user.email "github-actions[bot]@users.noreply.github.com"
70+
git add Formula/ronyup.rb
71+
git commit -m "ronyup ${{ steps.meta.outputs.version }}"
72+
git push

README.MD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ A Go toolkit for building high-performance API servers. Define your contracts on
1212

1313
### 1. Install the scaffolding tool
1414

15+
With Homebrew (macOS/Linux):
16+
17+
```bash
18+
brew install clubpay/tap/ronyup
19+
```
20+
21+
Or with Go:
22+
1523
```bash
1624
go install github.com/clubpay/ronykit/ronyup@latest
1725
```

docs/ronyup-guide.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222

2323
## Installation
2424

25+
With [Homebrew](https://brew.sh/) (macOS/Linux):
26+
27+
```bash
28+
brew install clubpay/tap/ronyup
29+
```
30+
31+
This taps `clubpay/homebrew-tap` and builds `ronyup` from source (a Go toolchain
32+
is fetched automatically at install time). Upgrade later with `brew upgrade ronyup`.
33+
34+
Or with the Go toolchain:
35+
2536
```bash
2637
go install github.com/clubpay/ronykit/ronyup@latest
2738
```
@@ -374,7 +385,8 @@ ronyup
374385
├── text Generate translation catalogs
375386
├── template Inspect Go source for template metadata
376387
│ └── generate (stub — not yet implemented)
377-
└── mcp Start the MCP server
388+
├── mcp Start the MCP server
389+
└── version Print the ronyup version
378390
```
379391

380392
---

ronyup/README.MD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
## Install
66

7+
With Homebrew (macOS/Linux):
8+
9+
```bash
10+
brew install clubpay/tap/ronyup
11+
```
12+
713
From the repo root:
814

915
```bash
@@ -22,6 +28,7 @@ go install github.com/clubpay/ronykit/ronyup@latest
2228
- `text`: extract and generate translation catalogs using `golang.org/x/text/message/pipeline`.
2329
- `template`: parse Go source and print package/type/function metadata (generator stub).
2430
- `mcp`: run `ronyup` as a stdio MCP server for AI assistants.
31+
- `version`: print the `ronyup` version.
2532

2633
Running `ronyup setup` or `ronyup text` with no flags triggers an interactive TUI.
2734

@@ -159,6 +166,8 @@ Feature flags:
159166
## Installation
160167

161168
```bash
169+
brew install clubpay/tap/ronyup
170+
# or
162171
go install github.com/clubpay/ronykit/ronyup@latest
163172
```
164173

ronyup/cmd/mcp/mcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var Cmd = &cobra.Command{
3535

3636
server := newServer(ServerConfig{
3737
name: "RonyUP",
38-
version: "v0.0.1",
38+
version: internal.Version,
3939
instructions: kb.ServerInstructions,
4040
executable: exePath,
4141
skeletonFS: internal.Skeleton,

ronyup/cmd/version/version.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package version
2+
3+
import (
4+
"github.com/clubpay/ronykit/ronyup/internal"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var Cmd = &cobra.Command{
9+
Use: "version",
10+
Short: "Print the ronyup version",
11+
RunE: func(cmd *cobra.Command, _ []string) error {
12+
cmd.Println(internal.Version)
13+
14+
return nil
15+
},
16+
}

ronyup/internal/version.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package internal
2+
3+
// Version is the ronyup build version. It defaults to "dev" for local builds
4+
// and is overridden at release time via:
5+
//
6+
// -ldflags "-X github.com/clubpay/ronykit/ronyup/internal.Version=vX.Y.Z"
7+
var Version = "dev"

ronyup/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import (
55
"github.com/clubpay/ronykit/ronyup/cmd/setup"
66
"github.com/clubpay/ronykit/ronyup/cmd/template"
77
"github.com/clubpay/ronykit/ronyup/cmd/text"
8+
"github.com/clubpay/ronykit/ronyup/cmd/version"
9+
"github.com/clubpay/ronykit/ronyup/internal"
810
"github.com/spf13/cobra"
911
)
1012

1113
var RootCmd = &cobra.Command{
12-
Use: "ronyup",
14+
Use: "ronyup",
15+
Version: internal.Version,
1316
}
1417

1518
func main() {
16-
RootCmd.AddCommand(setup.Cmd, text.Cmd, template.Cmd, mcp.Cmd)
19+
RootCmd.AddCommand(setup.Cmd, text.Cmd, template.Cmd, mcp.Cmd, version.Cmd)
1720

1821
err := RootCmd.Execute()
1922
if err != nil {

0 commit comments

Comments
 (0)