Skip to content

Commit 3c1cb90

Browse files
bbornclaude
andcommitted
Add open source project infrastructure
- Add MIT license - Add GoReleaser config for automated cross-platform releases - Replace manual release workflow with goreleaser-action - Harden CI: race detector, coverage, govulncheck job, permissions - Improve golangci-lint: enable gosec, misspell, bodyclose, unconvert, errname linters; add goimports formatter with local-prefixes - Add dependabot for Go modules and GitHub Actions - Add CONTRIBUTING.md and SECURITY.md - Add Makefile targets: vet, vuln, audit, coverage; inject version ldflags into all builds; remove redundant release target - Add version variable to taskd for ldflags injection - Add .gitignore entries for dist/ and coverage artifacts - Add CI/Go Reference/Go Report Card badges to README - Fix goimports ordering across all Go files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1ec3871 commit 3c1cb90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+554
-310
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: weekly

.github/workflows/ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [main, master]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
name: Test
@@ -20,7 +23,7 @@ jobs:
2023
go-version: '1.24'
2124

2225
- name: Run tests
23-
run: go test -v -p 1 -count=1 ./...
26+
run: go test -v -race -p 1 -count=1 -coverprofile=coverage.out ./...
2427

2528
lint:
2629
name: Lint
@@ -39,6 +42,24 @@ jobs:
3942
with:
4043
version: v2.1.6
4144

45+
vulncheck:
46+
name: Vulnerability Check
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
51+
52+
- name: Set up Go
53+
uses: actions/setup-go@v5
54+
with:
55+
go-version: '1.24'
56+
57+
- name: Install govulncheck
58+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
59+
60+
- name: Run govulncheck
61+
run: govulncheck ./...
62+
4263
build:
4364
name: Build
4465
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,23 @@ permissions:
1010

1111
jobs:
1212
release:
13-
name: Build and Release
13+
name: Release
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1820

1921
- name: Set up Go
2022
uses: actions/setup-go@v5
2123
with:
2224
go-version: '1.24'
2325

24-
- name: Get version from tag
25-
id: version
26-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
27-
28-
- name: Build binaries
29-
run: |
30-
mkdir -p dist
31-
VERSION=${{ steps.version.outputs.VERSION }}
32-
LDFLAGS="-s -w -X main.version=${VERSION}"
33-
34-
# Build ty CLI for all platforms
35-
GOOS=darwin GOARCH=amd64 go build -ldflags="${LDFLAGS}" -o dist/ty-darwin-amd64 ./cmd/task
36-
GOOS=darwin GOARCH=arm64 go build -ldflags="${LDFLAGS}" -o dist/ty-darwin-arm64 ./cmd/task
37-
GOOS=linux GOARCH=amd64 go build -ldflags="${LDFLAGS}" -o dist/ty-linux-amd64 ./cmd/task
38-
GOOS=linux GOARCH=arm64 go build -ldflags="${LDFLAGS}" -o dist/ty-linux-arm64 ./cmd/task
39-
40-
# Build taskd daemon for Linux only
41-
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o dist/taskd-linux-amd64 ./cmd/taskd
42-
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o dist/taskd-linux-arm64 ./cmd/taskd
43-
44-
- name: Create Release
45-
uses: softprops/action-gh-release@v2
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v6
4628
with:
47-
files: dist/*
48-
generate_release_notes: true
49-
draft: false
50-
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') || contains(github.ref, '-alpha') }}
29+
version: "~> v2"
30+
args: release --clean
5131
env:
5232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ bin/
3030
*.out
3131
.task-worktrees
3232

33-
# Build output
33+
# Build / release output
3434
/task
3535
/taskd
36+
dist/
37+
coverage.out
38+
coverage.html
3639

3740
# Database
3841
*.db

.golangci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
version: "2"
22
linters:
3+
enable:
4+
- gosec
5+
- misspell
6+
- bodyclose
7+
- unconvert
8+
- errname
39
disable:
410
- errcheck
511
settings:
@@ -17,6 +23,16 @@ linters:
1723
- common-false-positives
1824
- legacy
1925
- std-error-handling
26+
rules:
27+
- linters: [gosec]
28+
text: "G204:"
29+
- linters: [gosec]
30+
text: "G115:"
31+
- linters: [gosec]
32+
text: "G306:"
33+
- linters: [staticcheck]
34+
text: "SA5011"
35+
path: "_test\\.go"
2036
paths:
2137
- third_party$
2238
- builtin$
@@ -25,6 +41,12 @@ issues:
2541
max-issues-per-linter: 0
2642
max-same-issues: 0
2743
formatters:
44+
enable:
45+
- goimports
46+
settings:
47+
goimports:
48+
local-prefixes:
49+
- github.com/bborn/workflow
2850
exclusions:
2951
generated: lax
3052
paths:

.goreleaser.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
version: 2
2+
3+
builds:
4+
- id: ty
5+
main: ./cmd/task
6+
binary: ty
7+
ldflags:
8+
- -s -w -X main.version={{.Version}}
9+
goos:
10+
- darwin
11+
- linux
12+
- windows
13+
goarch:
14+
- amd64
15+
- arm64
16+
ignore:
17+
- goos: windows
18+
goarch: arm64
19+
20+
- id: taskd
21+
main: ./cmd/taskd
22+
binary: taskd
23+
# taskd is a daemon — no Windows build
24+
ldflags:
25+
- -s -w -X main.version={{.Version}}
26+
goos:
27+
- darwin
28+
- linux
29+
goarch:
30+
- amd64
31+
- arm64
32+
33+
archives:
34+
- id: ty
35+
builds:
36+
- ty
37+
format: tar.gz
38+
format_overrides:
39+
- goos: windows
40+
format: zip
41+
name_template: "ty_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
42+
43+
- id: taskd
44+
builds:
45+
- taskd
46+
format: tar.gz
47+
name_template: "taskd_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
48+
49+
checksum:
50+
name_template: "checksums.txt"
51+
52+
changelog:
53+
filters:
54+
exclude:
55+
- "^docs:"
56+
- "^test:"
57+
- "^ci:"
58+
- "^Merge"

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributing to Task You
2+
3+
Thanks for your interest in contributing!
4+
5+
## Development Setup
6+
7+
```bash
8+
git clone https://github.com/bborn/taskyou
9+
cd taskyou
10+
make build
11+
```
12+
13+
**Prerequisites:** Go 1.24+ (or use `mise install` to set up automatically).
14+
15+
## Common Make Targets
16+
17+
| Target | Description |
18+
|--------|-------------|
19+
| `make build` | Build `ty` and `taskd` binaries |
20+
| `make test` | Run tests with race detector |
21+
| `make lint` | Run golangci-lint |
22+
| `make vet` | Run `go vet` |
23+
| `make vuln` | Run `govulncheck` |
24+
| `make audit` | Run vet + vuln + lint + test |
25+
| `make fmt` | Format code |
26+
| `make coverage` | Generate HTML coverage report |
27+
28+
## Submitting a Pull Request
29+
30+
1. Fork the repo and create your branch from `main`.
31+
2. Make your changes.
32+
3. Run `make audit` to verify everything passes.
33+
4. Open a pull request with a clear description of the change.
34+
35+
## Code Style
36+
37+
- Follow standard Go conventions (`gofmt`, `goimports`).
38+
- Keep PRs focused — one logical change per PR.
39+
- Add tests for new functionality.
40+
41+
## Reporting Bugs
42+
43+
Open an issue at [github.com/bborn/taskyou/issues](https://github.com/bborn/taskyou/issues) with:
44+
- Steps to reproduce
45+
- Expected vs actual behavior
46+
- Go version and OS

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Bruno Born
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
.PHONY: build build-no-restart install clean test deploy
1+
.PHONY: build build-no-restart build-ty build-taskd restart-daemon build-linux \
2+
install clean test vet vuln audit coverage run daemon \
3+
deploy deploy-service deploy-full status logs connect tag fmt lint
24

35
# Configuration
46
SERVER ?= root@cloud-claude
@@ -8,18 +10,22 @@ REMOTE_DIR ?= /home/runner
810
# Allow overriding the Go binary/toolchain (e.g. GO=go1.24.4 or mise exec -- go)
911
GO ?= go
1012

13+
# Version from git tag (e.g. v0.2.3 → 0.2.3), falls back to "dev"
14+
VERSION ?= $(shell git describe --tags --always 2>/dev/null | sed 's/^v//' || echo dev)
15+
LDFLAGS := -s -w -X main.version=$(VERSION)
16+
1117
# Build all binaries and (optionally) restart daemon if running
1218
build: build-ty build-taskd restart-daemon
1319

1420
# Build binaries without touching any running daemon
1521
build-no-restart: build-ty build-taskd
1622

1723
build-ty:
18-
$(GO) build -o bin/ty ./cmd/task
24+
$(GO) build -ldflags="$(LDFLAGS)" -o bin/ty ./cmd/task
1925
ln -sf ty bin/taskyou
2026

2127
build-taskd:
22-
$(GO) build -o bin/taskd ./cmd/taskd
28+
$(GO) build -ldflags="$(LDFLAGS)" -o bin/taskd ./cmd/taskd
2329

2430
# Restart daemon if it's running (silent if not). Never fail the build if we lack permissions.
2531
restart-daemon:
@@ -34,21 +40,38 @@ restart-daemon:
3440

3541
# Build for Linux (server deployment)
3642
build-linux:
37-
GOOS=linux GOARCH=amd64 go build -o bin/taskd-linux ./cmd/taskd
43+
GOOS=linux GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o bin/taskd-linux ./cmd/taskd
3844

3945
# Install to GOBIN (usually ~/go/bin) - installs as 'ty', 'taskyou' (symlink), and 'taskd'
4046
install:
41-
go build -o $(shell go env GOBIN)/ty ./cmd/task
47+
go build -ldflags="$(LDFLAGS)" -o $(shell go env GOBIN)/ty ./cmd/task
4248
ln -sf ty $(shell go env GOBIN)/taskyou
43-
go install ./cmd/taskd
49+
go build -ldflags="$(LDFLAGS)" -o $(shell go env GOBIN)/taskd ./cmd/taskd
4450

4551
# Clean build artifacts
4652
clean:
47-
rm -rf bin/
53+
rm -rf bin/ dist/
4854

49-
# Run tests
55+
# Run tests with race detector
5056
test:
51-
go test ./...
57+
go test -race ./...
58+
59+
# Run go vet
60+
vet:
61+
go vet ./...
62+
63+
# Run govulncheck
64+
vuln:
65+
govulncheck ./...
66+
67+
# Run all checks: vet, vuln, lint, test
68+
audit: vet vuln lint test
69+
70+
# Generate HTML coverage report
71+
coverage:
72+
go test -race -coverprofile=coverage.out ./...
73+
go tool cover -html=coverage.out -o coverage.html
74+
@echo "Coverage report: coverage.html"
5275

5376
# Run the TUI locally (ty command)
5477
run:
@@ -102,15 +125,6 @@ endif
102125
@echo "Done! GitHub Actions will build and publish the release."
103126
@echo "View at: https://github.com/bborn/taskyou/releases/tag/$(VERSION)"
104127

105-
# Build for release (all platforms)
106-
release:
107-
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o bin/ty-darwin-amd64 ./cmd/task
108-
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o bin/ty-darwin-arm64 ./cmd/task
109-
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/ty-linux-amd64 ./cmd/task
110-
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o bin/ty-linux-arm64 ./cmd/task
111-
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/taskd-linux-amd64 ./cmd/taskd
112-
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o bin/taskd-linux-arm64 ./cmd/taskd
113-
114128
# Format code
115129
fmt:
116130
go fmt ./...

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![CI](https://github.com/bborn/taskyou/actions/workflows/ci.yml/badge.svg)](https://github.com/bborn/taskyou/actions/workflows/ci.yml)
2+
[![Go Reference](https://pkg.go.dev/badge/github.com/bborn/workflow.svg)](https://pkg.go.dev/github.com/bborn/workflow)
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/bborn/workflow)](https://goreportcard.com/report/github.com/bborn/workflow)
4+
15
# Task You
26

37
A personal task management system with a beautiful terminal UI, SQLite storage, and background task execution via pluggable AI agents (Claude Code, OpenAI Codex, Gemini, Pi, OpenClaw, or OpenCode).

0 commit comments

Comments
 (0)