Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: write

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Vet
run: go vet ./...

- name: Test
run: go test -race ./...

goreleaser:
needs: test
runs-on: ubuntu-latest
environment: prod

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
47 changes: 47 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
project_name: brew-potato

before:
hooks:
- go mod tidy

builds:
- id: brew-potato
main: .
binary: brew-potato
goos:
- darwin
- linux
goarch:
- amd64
- arm64

archives:
- format: tar.gz

checksum:
name_template: "checksums.txt"

release:
github:
owner: mrSamDev
name: brew-potato

brews:
- name: brew-potato
homepage: https://github.com/mrSamDev/brew-potato
description: A cute TUI for managing Homebrew apps
license: MIT

repository:
owner: mrSamDev
name: homebrew-tap
token: "{{ .Env.GITHUB_TOKEN }}"

commit_author:
name: mrSamDev
email: dev.sijo.sam@gmail.com

directory: Formula

install: |
bin.install "brew-potato"
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ brew-ui/
└── go.sum
```

## Next Steps

[GoReleaser](https://github.com/goreleaser/goreleaser) can publish brew-potato as an actual Homebrew formula so anyone can install it with `brew install`. It handles cross-compilation, GitHub release assets, and writing the formula to a tap repo automatically.
### Install via Homebrew

```sh
brew install mrSamDev/tap/brew-potato
```

## Keybindings

Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tasks:
build:
desc: Build the binary
cmds:
- go build -o bin/brew-ui ./main.go
- go build -o bin/brew-potato ./main.go

test:
desc: Run all tests
Expand Down
9 changes: 9 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@
</div>
</section>

<!-- install -->
<section class="section">
<div class="section-label">install</div>
<div class="code-block">
<div class="comment"># install with Homebrew</div>
<div class="cmd">brew install mrSamDev/tap/brew-potato</div>
</div>
</section>

<!-- keybindings -->
<section class="section">
<div class="section-label">keybindings</div>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/mrSamDev/brew-ui-potato
module github.com/mrSamDev/brew-potato

go 1.24.4

Expand Down
2 changes: 1 addition & 1 deletion internal/brew/brew_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/mrSamDev/brew-ui-potato/internal/brew"
"github.com/mrSamDev/brew-potato/internal/brew"
)

// brewJSONMultiple contains four formulae that exercise all filter paths:
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ui
import (
tea "charm.land/bubbletea/v2"

"github.com/mrSamDev/brew-ui-potato/internal/brew"
"github.com/mrSamDev/brew-potato/internal/brew"
)

func (m Model) handleKey(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"charm.land/bubbles/v2/table"
tea "charm.land/bubbletea/v2"

"github.com/mrSamDev/brew-ui-potato/internal/brew"
"github.com/mrSamDev/brew-potato/internal/brew"
)

const (
Expand Down
4 changes: 1 addition & 3 deletions internal/ui/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"charm.land/bubbles/v2/table"
tea "charm.land/bubbletea/v2"

"github.com/mrSamDev/brew-ui-potato/internal/brew"
"github.com/mrSamDev/brew-potato/internal/brew"
)

var testPkgs = []brew.Package{
Expand Down Expand Up @@ -49,7 +49,6 @@ func mustModel(t *testing.T, m tea.Model) Model {
return model
}


func TestInit_returnsCmd(t *testing.T) {
m := newTestModel(testPkgs)
m.isInitialLoading = true
Expand Down Expand Up @@ -176,4 +175,3 @@ func TestUpdate_uninstallDone_failure(t *testing.T) {
t.Error("isLoading should be false after uninstall failure")
}
}

2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

tea "charm.land/bubbletea/v2"

"github.com/mrSamDev/brew-ui-potato/internal/ui"
"github.com/mrSamDev/brew-potato/internal/ui"
)

func main() {
Expand Down