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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ jobs:
- name: Build binary
run: go build ./cmd/go-chrome-ai

- name: Build CLI release targets
run: |
mkdir -p /tmp/go-chrome-ai-cross
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /tmp/go-chrome-ai-cross/go-chrome-ai-linux-amd64 ./cmd/cli
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o /tmp/go-chrome-ai-cross/go-chrome-ai-linux-arm64 ./cmd/cli
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o /tmp/go-chrome-ai-cross/go-chrome-ai-windows-amd64.exe ./cmd/cli
GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build -o /tmp/go-chrome-ai-cross/go-chrome-ai-windows-arm64.exe ./cmd/cli

- name: Check GoReleaser config
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
28 changes: 26 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ before:
- go test ./...

builds:
- id: go-chrome-ai
- id: go-chrome-ai-macos
main: ./cmd/go-chrome-ai
binary: go-chrome-ai
env:
Expand All @@ -21,14 +21,38 @@ builds:
- -trimpath
ldflags:
- -s -w
- id: go-chrome-ai-cli
main: ./cmd/cli
binary: go-chrome-ai
env:
- CGO_ENABLED=0
goos:
- linux
- windows
goarch:
- amd64
- arm64
flags:
- -trimpath
ldflags:
- -s -w

archives:
- id: release
ids:
- go-chrome-ai
- go-chrome-ai-macos
- go-chrome-ai-cli
formats:
- tar.gz
format_overrides:
- goos: windows
formats:
- zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- README.md
- LICENSE
- PUBLISHING.md

checksum:
name_template: checksums.txt
Expand Down
18 changes: 12 additions & 6 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,30 @@ The repository includes `.github/workflows/ci.yml` to run:
Tagging a semantic version triggers `.github/workflows/release.yml`.

```bash
git tag v1.0.4
git push origin v1.0.4
git tag v1.0.5
git push origin v1.0.5
```

That workflow publishes release archives and `checksums.txt` through GoReleaser.

Published macOS assets follow the same versioned artifact pattern as the other managed repos:
Published assets follow the same versioned artifact pattern as the other managed repos:

- `go-chrome-ai_1.0.4_darwin_arm64.tar.gz`
- `go-chrome-ai_1.0.4_darwin_amd64.tar.gz`
- `go-chrome-ai_1.0.5_darwin_arm64.tar.gz`
- `go-chrome-ai_1.0.5_darwin_amd64.tar.gz`
- `go-chrome-ai_1.0.5_linux_arm64.tar.gz`
- `go-chrome-ai_1.0.5_linux_amd64.tar.gz`
- `go-chrome-ai_1.0.5_windows_arm64.zip`
- `go-chrome-ai_1.0.5_windows_amd64.zip`
- `checksums.txt`

The macOS archives package the GUI-capable entrypoint. Linux and Windows archives package the CLI binary for easier cross-platform distribution.

## Homebrew Cask

After the release is live:

```bash
./scripts/render-homebrew-cask.sh --owner itamaker --version v1.0.4 > /path/to/homebrew-tap/Casks/go-chrome-ai.rb
./scripts/render-homebrew-cask.sh --owner itamaker --version v1.0.5 > /path/to/homebrew-tap/Casks/go-chrome-ai.rb
```

Commit the rendered file to `https://github.com/itamaker/homebrew-tap` as `Casks/go-chrome-ai.rb`.
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,31 @@ brew install --cask itamaker/tap/go-chrome-ai
<details>
<summary>You can also install with the shell installer or download binaries from <a href="https://github.com/itamaker/go-chrome-ai/releases">GitHub Releases</a>.</summary>

Shell installer:
Shell installer for macOS and Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/itamaker/go-chrome-ai/main/scripts/install.sh | sh
```

Current release archives:

- macOS (Apple Silicon/arm64): `go-chrome-ai_1.0.4_darwin_arm64.tar.gz`
- macOS (Intel/x86_64): `go-chrome-ai_1.0.4_darwin_amd64.tar.gz`
- macOS (Apple Silicon/arm64): `go-chrome-ai_1.0.5_darwin_arm64.tar.gz`
- macOS (Intel/x86_64): `go-chrome-ai_1.0.5_darwin_amd64.tar.gz`
- Linux (arm64): `go-chrome-ai_1.0.5_linux_arm64.tar.gz`
- Linux (x86_64): `go-chrome-ai_1.0.5_linux_amd64.tar.gz`
- Windows (arm64): `go-chrome-ai_1.0.5_windows_arm64.zip`
- Windows (x86_64): `go-chrome-ai_1.0.5_windows_amd64.zip`

Each archive contains a single executable: `go-chrome-ai`.
The macOS archives include the GUI-capable binary. Linux and Windows releases ship the CLI binary for portable installs.

</details>

The install script also accepts:

```bash
# Install a specific release into a custom directory
curl -fsSL https://raw.githubusercontent.com/itamaker/go-chrome-ai/main/scripts/install.sh | VERSION=v1.0.4 INSTALL_DIR=$HOME/bin sh
curl -fsSL https://raw.githubusercontent.com/itamaker/go-chrome-ai/main/scripts/install.sh | VERSION=v1.0.5 INSTALL_DIR=$HOME/bin sh
```

Set `SKIP_PATH_SETUP=1` if you do not want the installer to edit your shell profile.
Expand All @@ -53,8 +58,8 @@ Set `SKIP_PATH_SETUP=1` if you do not want the installer to edit your shell prof
Run:

```bash
go-chrome-ai # CLI mode
go-chrome-ai gui # GUI mode
go-chrome-ai # CLI mode on every release
go-chrome-ai gui # GUI mode on macOS release builds or source builds
```

On some macOS systems, Gatekeeper may block first launch for downloaded binaries. If that happens, run:
Expand Down Expand Up @@ -99,6 +104,8 @@ Flags:
go run ./cmd/go-chrome-ai gui
```

Prebuilt Linux and Windows releases are CLI-only. Build from source if you want the Fyne GUI on those platforms.

The GUI includes:

- auto-detection of installed Chrome channels
Expand Down Expand Up @@ -127,8 +134,8 @@ Local build output is written to `output/`. GoReleaser packaging output is writt
Installed binary usage:

```bash
go-chrome-ai # CLI mode
go-chrome-ai gui # GUI mode
go-chrome-ai # CLI mode on every release
go-chrome-ai gui # GUI mode on macOS release builds or source builds
```

## What It Does
Expand Down
3 changes: 2 additions & 1 deletion cmd/go-chrome-ai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import (
"os"

"github.com/itamaker/go-chrome-ai/internal/app"
"github.com/itamaker/go-chrome-ai/internal/guiapp"
)

func main() {
args := os.Args[1:]
if len(args) > 0 {
switch args[0] {
case "gui":
app.RunGUI()
guiapp.Run()
return
case "help", "-h", "--help":
printUsage()
Expand Down
4 changes: 2 additions & 2 deletions cmd/gui/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import "github.com/itamaker/go-chrome-ai/internal/app"
import "github.com/itamaker/go-chrome-ai/internal/guiapp"

func main() {
app.RunGUI()
guiapp.Run()
}
23 changes: 15 additions & 8 deletions docs/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,31 @@ brew install --cask itamaker/tap/go-chrome-ai
<details>
<summary>也可以通过安装脚本或 <a href="https://github.com/itamaker/go-chrome-ai/releases">GitHub Releases</a> 获取二进制。</summary>

安装脚本
适用于 macOS 和 Linux 的安装脚本

```bash
curl -fsSL https://raw.githubusercontent.com/itamaker/go-chrome-ai/main/scripts/install.sh | sh
```

当前发布包:

- macOS(Apple Silicon/arm64):`go-chrome-ai_1.0.4_darwin_arm64.tar.gz`
- macOS(Intel/x86_64):`go-chrome-ai_1.0.4_darwin_amd64.tar.gz`
- macOS(Apple Silicon/arm64):`go-chrome-ai_1.0.5_darwin_arm64.tar.gz`
- macOS(Intel/x86_64):`go-chrome-ai_1.0.5_darwin_amd64.tar.gz`
- Linux(arm64):`go-chrome-ai_1.0.5_linux_arm64.tar.gz`
- Linux(x86_64):`go-chrome-ai_1.0.5_linux_amd64.tar.gz`
- Windows(arm64):`go-chrome-ai_1.0.5_windows_arm64.zip`
- Windows(x86_64):`go-chrome-ai_1.0.5_windows_amd64.zip`

每个压缩包都只包含一个可执行文件:`go-chrome-ai`。
macOS 发布包包含 GUI 可执行能力;Linux 和 Windows 发布包默认提供 CLI,便于直接使用。

</details>

安装脚本也支持:

```bash
# 安装指定版本,并放到自定义目录
curl -fsSL https://raw.githubusercontent.com/itamaker/go-chrome-ai/main/scripts/install.sh | VERSION=v1.0.4 INSTALL_DIR=$HOME/bin sh
curl -fsSL https://raw.githubusercontent.com/itamaker/go-chrome-ai/main/scripts/install.sh | VERSION=v1.0.5 INSTALL_DIR=$HOME/bin sh
```

如果你不希望安装器修改 shell 配置文件,可设置 `SKIP_PATH_SETUP=1`。
Expand All @@ -51,8 +56,8 @@ curl -fsSL https://raw.githubusercontent.com/itamaker/go-chrome-ai/main/scripts/
运行:

```bash
go-chrome-ai # 命令行模式
go-chrome-ai gui # 图形界面模式
go-chrome-ai # 所有发布包都支持命令行模式
go-chrome-ai gui # macOS 发布包或源码构建支持图形界面模式
```

在某些 macOS 系统上,首次运行下载的二进制可能会被 Gatekeeper 拦截。可执行:
Expand Down Expand Up @@ -97,6 +102,8 @@ go run ./cmd/go-chrome-ai
go run ./cmd/go-chrome-ai gui
```

Linux 和 Windows 的预编译发布包默认只包含 CLI;如果需要 Fyne GUI,请从源码构建。

GUI 功能:

- 自动检测已安装的 Chrome 渠道
Expand Down Expand Up @@ -125,8 +132,8 @@ Makefile:
安装后的用法:

```bash
go-chrome-ai # 命令行模式
go-chrome-ai gui # 图形界面模式
go-chrome-ai # 所有发布包都支持命令行模式
go-chrome-ai gui # macOS 发布包或源码构建支持图形界面模式
```

## 执行流程
Expand Down
12 changes: 9 additions & 3 deletions docs/homebrew-cask.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ To support `brew install --cask`, publish the cask in your tap repo [`itamaker/h

Upload these files to each GitHub Release:

- `go-chrome-ai_1.0.4_darwin_arm64.tar.gz`
- `go-chrome-ai_1.0.4_darwin_amd64.tar.gz`
- `go-chrome-ai_1.0.5_darwin_arm64.tar.gz`
- `go-chrome-ai_1.0.5_darwin_amd64.tar.gz`
- `go-chrome-ai_1.0.5_linux_arm64.tar.gz`
- `go-chrome-ai_1.0.5_linux_amd64.tar.gz`
- `go-chrome-ai_1.0.5_windows_arm64.zip`
- `go-chrome-ai_1.0.5_windows_amd64.zip`
- `checksums.txt`

The cask only consumes the two macOS archives, but the release can also ship Linux and Windows CLI packages under the same naming pattern.

You can generate them via:

```bash
Expand All @@ -25,7 +31,7 @@ Each archive should contain:
Then update the cask:

```bash
./scripts/render-homebrew-cask.sh --owner itamaker --version v1.0.4 > /path/to/homebrew-tap/Casks/go-chrome-ai.rb
./scripts/render-homebrew-cask.sh --owner itamaker --version v1.0.5 > /path/to/homebrew-tap/Casks/go-chrome-ai.rb
```

## User install
Expand Down
Binary file modified docs/images/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions internal/app/gui.go → internal/guiapp/gui.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app
package guiapp

import (
"fmt"
Expand All @@ -14,7 +14,7 @@ import (
"github.com/itamaker/go-chrome-ai/internal/chrome"
)

func RunGUI() {
func Run() {
a := app.New()
w := a.NewWindow("go-chrome-ai")
w.Resize(fyne.NewSize(760, 560))
Expand Down
22 changes: 14 additions & 8 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ detect_platform() {
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
case "$OS" in
darwin) OS="darwin" ;;
linux) error "GitHub Releases currently publish macOS binaries only. Build from source on Linux." ;;
mingw*|msys*|cygwin*) error "Windows releases are not published yet. Build from source instead." ;;
linux) OS="linux" ;;
mingw*|msys*|cygwin*) error "Windows release archives are published as .zip files. Download them directly from GitHub Releases." ;;
*) error "Unsupported OS: $OS" ;;
esac

Expand Down Expand Up @@ -272,15 +272,21 @@ print_next_steps() {
say " ${BOLD}Run the CLI:${NC}"
say " ${CYAN}$BINARY_NAME${NC}"
say ""
say " ${BOLD}Launch the GUI:${NC}"
say " ${CYAN}$BINARY_NAME gui${NC}"
say ""
say " ${BOLD}Preview changes without writing:${NC}"
say " ${CYAN}$BINARY_NAME -dry-run${NC}"
say ""
say " ${BOLD}If macOS blocks the first launch:${NC}"
say " ${CYAN}xattr -d com.apple.quarantine \"$INSTALL_PATH\"${NC}"
say ""
if [ "$OS" = "darwin" ]; then
say " ${BOLD}Launch the GUI:${NC}"
say " ${CYAN}$BINARY_NAME gui${NC}"
say ""
say " ${BOLD}If macOS blocks the first launch:${NC}"
say " ${CYAN}xattr -d com.apple.quarantine \"$INSTALL_PATH\"${NC}"
say ""
else
say " ${BOLD}GUI mode:${NC}"
say " Build from source on Linux if you want the Fyne desktop app."
say ""
fi
say "${GREEN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
}

Expand Down
Loading