Skip to content

Commit c435c10

Browse files
committed
release: v0.2.0 — goreleaser, CI, Docker, full README, distribution
- Add goreleaser config (linux/darwin/windows × amd64/arm64) - Add GitHub Actions: release (goreleaser on tag) + test (3 OS × 3 Go versions + lint) - Add Dockerfile (Alpine-based) - Add Homebrew tap (4ier/homebrew-tap) and Scoop bucket (4ier/scoop-bucket) - Rewrite README: badges, 6 install methods, command table, feature showcase - Wire version via ldflags - Update SKILL.md with new commands and install methods - Add DISTRIBUTION.md plan
1 parent 2fcf8b0 commit c435c10

8 files changed

Lines changed: 478 additions & 134 deletions

File tree

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: stable
25+
26+
- name: Login to GHCR
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v3
38+
39+
- name: Run GoReleaser
40+
uses: goreleaser/goreleaser-action@v6
41+
with:
42+
distribution: goreleaser
43+
version: "~> v2"
44+
args: release --clean
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
go: ["1.23", "1.24", "1.25"]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: ${{ matrix.go }}
23+
24+
- name: Build
25+
run: go build -v ./...
26+
27+
- name: Test
28+
run: go test -v -race ./...
29+
30+
lint:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version: stable
39+
40+
- name: golangci-lint
41+
uses: golangci/golangci-lint-action@v6
42+
with:
43+
version: latest

.goreleaser.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
version: 2
2+
3+
project_name: notion-cli
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
- go test ./...
9+
10+
builds:
11+
- env:
12+
- CGO_ENABLED=0
13+
goos:
14+
- linux
15+
- darwin
16+
- windows
17+
goarch:
18+
- amd64
19+
- arm64
20+
ldflags:
21+
- -s -w -X github.com/4ier/notion-cli/cmd.Version={{.Version}}
22+
binary: notion
23+
24+
archives:
25+
- format: tar.gz
26+
name_template: >-
27+
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
28+
format_overrides:
29+
- goos: windows
30+
format: zip
31+
32+
checksum:
33+
name_template: "checksums.txt"
34+
35+
changelog:
36+
sort: asc
37+
filters:
38+
exclude:
39+
- "^docs:"
40+
- "^test:"
41+
- "^ci:"
42+
- "^chore:"
43+
44+
brews:
45+
- repository:
46+
owner: 4ier
47+
name: homebrew-tap
48+
token: "{{ .Env.GITHUB_TOKEN }}"
49+
homepage: "https://github.com/4ier/notion-cli"
50+
description: "Full-featured CLI for Notion. Like gh for GitHub, but for Notion."
51+
license: "MIT"
52+
install: |
53+
bin.install "notion"
54+
test: |
55+
system "#{bin}/notion", "--version"
56+
57+
scoops:
58+
- repository:
59+
owner: 4ier
60+
name: scoop-bucket
61+
token: "{{ .Env.GITHUB_TOKEN }}"
62+
homepage: "https://github.com/4ier/notion-cli"
63+
description: "Full-featured CLI for Notion. Like gh for GitHub, but for Notion."
64+
license: "MIT"
65+
66+
dockers:
67+
- image_templates:
68+
- "ghcr.io/4ier/notion-cli:{{ .Version }}-amd64"
69+
use: buildx
70+
build_flag_templates:
71+
- "--platform=linux/amd64"
72+
goarch: amd64
73+
- image_templates:
74+
- "ghcr.io/4ier/notion-cli:{{ .Version }}-arm64"
75+
use: buildx
76+
build_flag_templates:
77+
- "--platform=linux/arm64"
78+
goarch: arm64
79+
80+
docker_manifests:
81+
- name_template: "ghcr.io/4ier/notion-cli:{{ .Version }}"
82+
image_templates:
83+
- "ghcr.io/4ier/notion-cli:{{ .Version }}-amd64"
84+
- "ghcr.io/4ier/notion-cli:{{ .Version }}-arm64"
85+
- name_template: "ghcr.io/4ier/notion-cli:latest"
86+
image_templates:
87+
- "ghcr.io/4ier/notion-cli:{{ .Version }}-amd64"
88+
- "ghcr.io/4ier/notion-cli:{{ .Version }}-arm64"
89+
90+
nfpms:
91+
- homepage: "https://github.com/4ier/notion-cli"
92+
maintainer: "Fourier <yang.fourier@gmail.com>"
93+
description: "Full-featured CLI for Notion. Like gh for GitHub, but for Notion."
94+
license: "MIT"
95+
formats:
96+
- deb
97+
- rpm

DISTRIBUTION.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Notion CLI 分发方案
2+
3+
## 一、安装渠道(按优先级排序)
4+
5+
### Tier 1 — 必须做(覆盖 80% 用户)
6+
7+
| 渠道 | 目标用户 | 实现方式 | 工作量 |
8+
|------|---------|---------|--------|
9+
| **GitHub Releases** | 所有平台 | goreleaser + GitHub Actions | 1h |
10+
| **go install** | Go 开发者 | 已就绪(`go install github.com/4ier/notion-cli@latest`| 0 |
11+
| **Homebrew Tap** | macOS/Linux 开发者 | goreleaser 自动生成 formula → `4ier/homebrew-tap` | 30min |
12+
13+
### Tier 2 — 应该做(扩大覆盖)
14+
15+
| 渠道 | 目标用户 | 实现方式 | 工作量 |
16+
|------|---------|---------|--------|
17+
| **npm wrapper** | Node.js/agent 生态 | 轻量 npm 包 `@4ier/notion-cli`,postinstall 拉二进制 | 2h |
18+
| **Docker** | CI/CD/自动化 | `ghcr.io/4ier/notion-cli` | 30min |
19+
| **Scoop** | Windows | goreleaser 内置 scoop manifest | 15min |
20+
21+
### Tier 3 — 锦上添花(长尾)
22+
23+
| 渠道 | 目标用户 | 实现方式 | 工作量 |
24+
|------|---------|---------|--------|
25+
| **AUR** | Arch Linux | PKGBUILD | 30min |
26+
| **Nix** | NixOS | flake.nix | 1h |
27+
| **skills.sh** | AI agent | 已就绪 | 0 |
28+
29+
---
30+
31+
## 二、实现计划
32+
33+
### Phase 1: goreleaser + CI(今天)
34+
35+
```
36+
.goreleaser.yaml
37+
├── builds: linux/darwin/windows × amd64/arm64
38+
├── archives: tar.gz (unix) / zip (windows)
39+
├── checksum: SHA256
40+
├── homebrew_formulas: 4ier/homebrew-tap
41+
├── scoop: 4ier/scoop-bucket
42+
└── changelog: auto from git
43+
44+
.github/workflows/release.yml
45+
├── on: push tags v*
46+
├── setup-go
47+
├── goreleaser-action
48+
└── GITHUB_TOKEN (auto)
49+
```
50+
51+
**执行步骤:**
52+
1. 创建 `.goreleaser.yaml`
53+
2. 创建 `.github/workflows/release.yml` + `.github/workflows/test.yml`
54+
3. 创建 `4ier/homebrew-tap``4ier/scoop-bucket` 仓库
55+
4. 打 tag `v0.2.0`,推送触发自动发布
56+
5. 验证: `brew install 4ier/tap/notion-cli`
57+
58+
### Phase 2: npm wrapper(本周)
59+
60+
```
61+
notion-cli-npm/
62+
├── package.json # name: @4ier/notion-cli
63+
├── install.js # postinstall: 检测平台 → 下载对应 GitHub Release 二进制
64+
├── bin/notion # shell wrapper → 执行下载的二进制
65+
└── README.md
66+
```
67+
68+
用户体验: `npx @4ier/notion-cli search "meeting notes"`
69+
70+
### Phase 3: Docker(本周)
71+
72+
```dockerfile
73+
FROM alpine:3.21
74+
COPY notion /usr/local/bin/
75+
ENTRYPOINT ["notion"]
76+
```
77+
78+
goreleaser 内置 Docker 支持,一并配置。
79+
80+
---
81+
82+
## 三、推广渠道(按 ROI 排序)
83+
84+
### 高 ROI
85+
| 渠道 | 策略 | 时机 |
86+
|------|------|------|
87+
| **r/Notion** (1.2M members) | "I built a CLI for Notion" 帖,demo GIF,链接 GitHub | v0.2.0 发布当天 |
88+
| **Hacker News** | Show HN: Full Notion CLI — 38 commands | 同上,UTC 上午 |
89+
| **X/Twitter** | 线程:问题→方案→demo→链接,@NotionHQ | 同上 |
90+
91+
### 中 ROI
92+
| 渠道 | 策略 | 时机 |
93+
|------|------|------|
94+
| **r/commandline** | 侧重 CLI 设计哲学(gh 对标) | 发布 +1 天 |
95+
| **Product Hunt** | 完整 launch page | 发布 +3 天 |
96+
| **Dev.to / Hashnode** | 技术文章:Notion API → CLI 的设计决策 | 发布 +1 周 |
97+
98+
### 长尾
99+
| 渠道 | 策略 | 时机 |
100+
|------|------|------|
101+
| **Notion 社区** (Discord/论坛) | 作为工具分享 | 持续 |
102+
| **GitHub trending** | 靠 star 自然进入 | 有机增长 |
103+
| **Awesome Notion** | 提 PR 加入列表 | v0.2.0 后 |
104+
105+
---
106+
107+
## 四、推广素材(需要准备)
108+
109+
1. **Demo GIF/视频** — 30 秒终端录屏,展示核心流程:
110+
- `notion auth login``notion search``notion db query --filter``notion page create`
111+
-[vhs](https://github.com/charmbracelet/vhs) 或 asciinema 录制
112+
113+
2. **README 升级** — 加 badges、GIF、安装方式表格、对标竞品
114+
115+
3. **一句话 pitch**: "Like `gh` for GitHub, but for Notion. 39 commands. One binary."
116+
117+
4. **Twitter 线程**(已有 Notion page 可以改写)
118+
119+
---
120+
121+
## 五、时间线
122+
123+
| 日期 | 里程碑 |
124+
|------|--------|
125+
| 2/19 | goreleaser + CI + homebrew tap + scoop ✅ |
126+
| 2/19 | 打 v0.2.0 tag,触发首次自动发布 |
127+
| 2/19 | README 升级 + demo GIF 录制 |
128+
| 2/20 | npm wrapper 发布 |
129+
| 2/20 | r/Notion + HN + X 同步发帖 |
130+
| 2/21 | Product Hunt 准备 |
131+
| 2/22 | Docker image + Awesome Notion PR |
132+
| 持续 | 根据反馈迭代,社区回复 |
133+
134+
---
135+
136+
## 六、成功指标
137+
138+
| 指标 | 1 周目标 | 1 月目标 |
139+
|------|---------|---------|
140+
| GitHub Stars | 50 | 300 |
141+
| npm 周下载 | 20 | 100 |
142+
| Homebrew 安装 | 10 | 50 |
143+
| GitHub Issues | 5 | 20 |
144+
| skills.sh 安装 | 10 | 50 |

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM alpine:3.21
2+
RUN apk add --no-cache ca-certificates
3+
COPY notion /usr/local/bin/notion
4+
ENTRYPOINT ["notion"]

0 commit comments

Comments
 (0)