Skip to content

Commit e909440

Browse files
authored
Merge pull request #6 from maphew:auto-release
automated build and release infrastructure for beady. let's find out if this works!
2 parents f7ce3a0 + 42a2f21 commit e909440

File tree

6 files changed

+243
-14
lines changed

6 files changed

+243
-14
lines changed

.beads/issues.jsonl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,11 @@
3535
{"id":"beady-5","content_hash":"6a2f7cc5014cb2480a54c9acd9f26e16ccad8a47773e88655db48b9638fd7445","title":"add feature: live reload","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-23T02:50:14.475464102-07:00","updated_at":"2025-10-26T19:44:25.3404749-07:00","closed_at":"2025-10-23T03:25:18.353531264-07:00"}
3636
{"id":"beady-7","content_hash":"5b2e3098e3a7f4363fc8f2d647f97a3ec5b9f8a4525fd406745fd8645dbe82a2","title":"missing templates causing panic in dev mode","description":"","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-24T05:38:00.486024544-07:00","updated_at":"2025-10-26T19:44:25.3450313-07:00","closed_at":"2025-10-24T05:42:56.941119818-07:00"}
3737
{"id":"beady-8","content_hash":"040645dd42eef87c67cb0210f4272e57a3f3322614c9214cd8b924f45abdb5af","title":"why template \u0026 static in root and in cmd/bd-ui? which location is best practice?","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-24T05:50:56.38010406-07:00","updated_at":"2025-10-26T19:44:25.34703-07:00","closed_at":"2025-10-24T05:53:33.7105026-07:00"}
38+
{"id":"beady-89d5","content_hash":"c2bd99fd4d23f72efc351782e11208108b7852f2fffd7152e2a135fe339c1087","title":"feat: if port conflict on launch, check if is used by beady, when yes issue api shutdown command and then re-attempt launch. if no use next available port","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-31T15:00:46.6322697-07:00","updated_at":"2025-10-31T15:00:46.6322697-07:00"}
3839
{"id":"beady-9","content_hash":"614924ca786cdd912f1087f9daeecdae4841130b69fa4aafabe3db3db3bbfdd4","title":"Fix asset paths in main.go after restructure","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-24T06:08:53.974194168-07:00","updated_at":"2025-10-26T19:44:25.3495258-07:00","closed_at":"2025-10-24T06:09:05.155951649-07:00"}
40+
{"id":"beady-d424","content_hash":"3c0d46785080729d9f66add2510bd9e18e0fd53fa38d83473865a0e1e82182f1","title":"infra: auto-build and create release packages on github","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-31T14:23:57.7231922-07:00","updated_at":"2025-10-31T14:23:57.7231922-07:00"}
41+
{"id":"beady-d424.1","content_hash":"51d64df4a67783df2b4d6bf9f281e5cafd5f7181000c3e60135ef590e036fa64","title":"Create .goreleaser.yml configuration for multi-platform builds","description":"Configure GoReleaser to build beady for Windows (amd64, arm64), Linux (amd64, arm64, 386), and macOS (amd64, arm64). Should respect the embedded assets pattern.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-31T15:37:29.8839718-07:00","updated_at":"2025-10-31T15:42:53.5700649-07:00","closed_at":"2025-10-31T15:42:53.5700649-07:00"}
42+
{"id":"beady-d424.2","content_hash":"cb66dd79c9d02902135b061b4b86a6fe0e2b0e10286c047ed67b61010facc301","title":"Create GitHub Actions workflow for automated releases","description":"Set up .github/workflows/release.yml that triggers on tag push, runs GoReleaser, and creates GitHub releases with binaries attached","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-31T15:37:34.8777658-07:00","updated_at":"2025-10-31T15:42:57.6983142-07:00","closed_at":"2025-10-31T15:42:57.6983142-07:00"}
43+
{"id":"beady-d424.3","content_hash":"add3af0663ea6d47d79a43b3730f6eb2ba4cf7261379c053eaad96ecc33dfeaa","title":"Update README.md with new release process and download instructions","description":"Document how to download pre-built binaries from GitHub releases, update release process to use tags + GitHub Actions instead of manual go install, and add badges for latest release","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-31T15:37:40.2752632-07:00","updated_at":"2025-10-31T15:43:40.5479827-07:00","closed_at":"2025-10-31T15:43:40.5479827-07:00"}
44+
{"id":"beady-d424.4","content_hash":"191c763aa4cc65af2a6ad750233cbcdb3b369fc25a3cb399773ea98c593148ed","title":"Test release workflow with test tag","description":"Create a test tag (e.g., v0.0.1-test) to verify the GitHub Actions workflow runs correctly, builds all platforms, and creates a draft release","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-31T15:37:44.9441448-07:00","updated_at":"2025-10-31T15:37:44.9441448-07:00"}
45+
{"id":"beady-da50","content_hash":"1e282ae329adc6a557be4aeb938ced5ac6fca66761e3e0b504a5d63f6116968c","title":"feat: add self-update to download and install latest binary. See go-update, https://github.com/inconshreveable/go-update","description":"","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-31T14:23:05.7770007-07:00","updated_at":"2025-10-31T14:23:05.7770007-07:00"}

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"Bash(git pull:*)",
2727
"Bash(git checkout:*)",
2828
"Bash(.binbeady.exe --dev)",
29-
"Bash(git log:*)"
29+
"Bash(git log:*)",
30+
"Bash(where:*)"
3031
],
3132
"deny": [],
3233
"ask": []

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.24'
26+
cache: true
27+
28+
- name: Install build dependencies
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install -y gcc-multilib gcc-mingw-w64
32+
33+
- name: Run GoReleaser
34+
uses: goreleaser/goreleaser-action@v6
35+
with:
36+
distribution: goreleaser
37+
version: '~> v2'
38+
args: release --clean
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Upload artifacts
43+
uses: actions/upload-artifact@v4
44+
if: always()
45+
with:
46+
name: release-artifacts
47+
path: |
48+
dist/*.tar.gz
49+
dist/*.zip
50+
dist/checksums.txt

.goreleaser.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# GoReleaser configuration for beady
2+
# See https://goreleaser.com for documentation
3+
4+
version: 2
5+
6+
before:
7+
hooks:
8+
# Ensure dependencies are up to date
9+
- go mod tidy
10+
# Run tests before building
11+
- go test ./...
12+
13+
builds:
14+
- id: beady
15+
main: ./cmd/beady
16+
binary: beady
17+
env:
18+
- CGO_ENABLED=0
19+
goos:
20+
- linux
21+
- windows
22+
- darwin
23+
goarch:
24+
- amd64
25+
- arm64
26+
- "386"
27+
# Exclude invalid combinations
28+
ignore:
29+
- goos: darwin
30+
goarch: "386"
31+
- goos: windows
32+
goarch: arm64 # Windows ARM64 support is experimental
33+
# Build flags to ensure embedded assets are included
34+
flags:
35+
- -trimpath
36+
ldflags:
37+
- -s -w
38+
- -X github.com/maphew/beady/cmd/beady.version={{.Version}}
39+
- -X github.com/maphew/beady/cmd/beady.commit={{.Commit}}
40+
- -X github.com/maphew/beady/cmd/beady.date={{.Date}}
41+
42+
archives:
43+
- id: beady-archive
44+
format: tar.gz
45+
name_template: >-
46+
{{ .ProjectName }}_
47+
{{- .Version }}_
48+
{{- title .Os }}_
49+
{{- if eq .Arch "amd64" }}x86_64
50+
{{- else if eq .Arch "386" }}i386
51+
{{- else }}{{ .Arch }}{{ end }}
52+
{{- if .Arm }}v{{ .Arm }}{{ end }}
53+
format_overrides:
54+
- goos: windows
55+
format: zip
56+
files:
57+
- README.md
58+
- LICENSE
59+
- CLAUDE.md
60+
61+
checksum:
62+
name_template: 'checksums.txt'
63+
64+
snapshot:
65+
version_template: "{{ incpatch .Version }}-next"
66+
67+
changelog:
68+
sort: asc
69+
filters:
70+
exclude:
71+
- '^docs:'
72+
- '^test:'
73+
- '^chore:'
74+
- '^ci:'
75+
- Merge pull request
76+
- Merge branch
77+
78+
release:
79+
github:
80+
owner: maphew
81+
name: beady
82+
draft: false
83+
prerelease: auto
84+
mode: replace
85+
header: |
86+
## Beady {{.Tag}}
87+
88+
A web UI for the [beads](https://github.com/steveyegge/beads) issue tracker.
89+
90+
### Installation
91+
92+
Download the appropriate binary for your platform below, extract it, and add it to your PATH.
93+
94+
Or install via Go:
95+
```bash
96+
go install github.com/maphew/beady/cmd/beady@{{.Tag}}
97+
```
98+
footer: |
99+
---
100+
101+
**Full Changelog**: https://github.com/maphew/beady/compare/{{.PreviousTag}}...{{.Tag}}
102+
103+
## What's Next
104+
105+
See the [beady issue tracker](https://github.com/maphew/beady/issues) for upcoming features.
106+
107+
# Uncomment to publish to Homebrew tap (requires separate tap repository)
108+
# brews:
109+
# - repository:
110+
# owner: maphew
111+
# name: homebrew-tap
112+
# homepage: https://github.com/maphew/beady
113+
# description: A web UI for the beads issue tracker
114+
# license: MIT
115+
116+
# Uncomment to build Docker images
117+
# dockers:
118+
# - image_templates:
119+
# - "ghcr.io/maphew/beady:{{ .Version }}"
120+
# - "ghcr.io/maphew/beady:latest"
121+
# dockerfile: Dockerfile
122+
# build_flag_templates:
123+
# - "--pull"
124+
# - "--label=org.opencontainers.image.created={{.Date}}"
125+
# - "--label=org.opencontainers.image.title={{.ProjectName}}"
126+
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
127+
# - "--label=org.opencontainers.image.version={{.Version}}"

README.md

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,36 @@ All write operations are performed by executing the `bd` CLI, ensuring guarantee
4646

4747
### Prerequisites
4848

49-
- Go 1.21 or later
50-
- A beads database file
5149
- **bd CLI** in PATH (required for write operations) - install from [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
50+
- A beads database file (will be auto-discovered from `.beads/` directory)
5251

53-
### Quick install from Git
52+
### Download Pre-built Binaries (Recommended)
53+
54+
Download the latest release for your platform from [GitHub Releases](https://github.com/maphew/beady/releases):
55+
56+
- **Windows**: `beady_VERSION_Windows_x86_64.zip` (or `i386` for 32-bit)
57+
- **macOS**: `beady_VERSION_Darwin_x86_64.tar.gz` (or `arm64` for Apple Silicon)
58+
- **Linux**: `beady_VERSION_Linux_x86_64.tar.gz` (or `arm64`, `i386`)
59+
60+
Extract the binary and add it to your PATH.
61+
62+
### Install via Go
5463

5564
Install the latest release:
5665

5766
```bash
58-
go install github.com/maphew/beads-ui/cmd/beady@latest
67+
go install github.com/maphew/beady/cmd/beady@latest
5968
```
6069

61-
Or install the latest development version from main branch:
70+
Or install a specific version:
6271

6372
```bash
64-
go install github.com/maphew/beads-ui/cmd/beady@main
73+
go install github.com/maphew/beady/cmd/beady@v1.0.0
6574
```
6675

6776
This will install the `beady` binary to your `$GOPATH/bin` (usually `~/go/bin`).
6877

69-
### Building from source
78+
### Building from Source
7079

7180
1. Clone this repository:
7281
```bash
@@ -194,11 +203,27 @@ All write endpoints accept JSON request bodies with a `username` field for attri
194203

195204
### Releasing
196205

197-
This project follows semantic versioning. To release a new version:
198-
199-
1. Update the version in any relevant files (if needed)
200-
2. Create and push a git tag with the version (e.g., `git tag v1.0.0 && git push origin v1.0.0`)
201-
3. This will make the version available via `go install ...@latest`
206+
This project uses [GoReleaser](https://goreleaser.com/) with GitHub Actions for automated releases. To create a new release:
207+
208+
1. Ensure all changes are committed and pushed to `main` branch
209+
2. Create and push a version tag following semantic versioning:
210+
```bash
211+
git tag v1.0.0
212+
git push origin v1.0.0
213+
```
214+
3. GitHub Actions will automatically:
215+
- Build binaries for all platforms (Linux, Windows, macOS)
216+
- Generate checksums
217+
- Create a GitHub release with all artifacts
218+
- Make the version available via `go install ...@latest`
219+
220+
The release will include:
221+
- Multi-platform binaries (amd64, arm64, 386)
222+
- Archives (`.tar.gz` for Unix, `.zip` for Windows)
223+
- Checksums for verification
224+
- Automated changelog from commits
225+
226+
**Testing a release**: To test the release process without creating an official release, push a tag with a `-test` suffix (e.g., `v0.0.1-test`).
202227

203228
## Dependencies
204229

cmd/beady/main.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ import (
2828
"github.com/steveyegge/beads"
2929
)
3030

31+
// Build information set by GoReleaser via ldflags
32+
var (
33+
version = "dev"
34+
commit = "none"
35+
date = "unknown"
36+
)
37+
3138
var embedFS = beady.FS
3239

3340
var tmplFS fs.FS
@@ -109,23 +116,31 @@ var store beads.Storage
109116
var devMode bool
110117

111118
var help = flag.Bool("help", false, "Show help")
119+
var showVersion = flag.Bool("version", false, "Show version information")
112120

113121
var detectedUsername string
114122

115123
var srv *http.Server
116124

117125
func printUsage() {
118-
fmt.Fprintf(os.Stderr, "Usage: %s [database-path] [port] [-d] [--help]\n", os.Args[0])
126+
fmt.Fprintf(os.Stderr, "Usage: %s [database-path] [port] [-d] [--help] [--version]\n", os.Args[0])
119127
fmt.Fprintf(os.Stderr, "Options:\n")
120128
fmt.Fprintf(os.Stderr, " -d, --dev Enable development mode with live reload\n")
121129
fmt.Fprintf(os.Stderr, " -h, --help Show help\n")
130+
fmt.Fprintf(os.Stderr, " --version Show version information\n")
122131
fmt.Fprintf(os.Stderr, "Examples:\n")
123132
fmt.Fprintf(os.Stderr, " %s # autodiscover database\n", os.Args[0])
124133
fmt.Fprintf(os.Stderr, " %s .beads/name.db # specify database path\n", os.Args[0])
125134
fmt.Fprintf(os.Stderr, " %s .beads/name.db 8080 # specify path and port\n", os.Args[0])
126135
fmt.Fprintf(os.Stderr, " %s -d .beads/name.db 8080 # enable live reload\n", os.Args[0])
127136
}
128137

138+
func printVersion() {
139+
fmt.Printf("beady %s\n", version)
140+
fmt.Printf(" commit: %s\n", commit)
141+
fmt.Printf(" built: %s\n", date)
142+
}
143+
129144
var upgrader = websocket.Upgrader{
130145
CheckOrigin: func(r *http.Request) bool { return true }, // Allow all origins for dev
131146
}
@@ -261,6 +276,10 @@ func main() {
261276
flag.Usage()
262277
os.Exit(0)
263278
}
279+
if *showVersion {
280+
printVersion()
281+
os.Exit(0)
282+
}
264283

265284
// Detect username for attribution
266285
detectedUsername = detectUsername()

0 commit comments

Comments
 (0)