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
33 changes: 10 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ on:
- 'v*.*.*'

permissions:
contents: write # needed to create releases and upload assets
contents: write # needed to create releases, upload assets, and commit formula

jobs:
release:
name: Build & Release
name: GoReleaser
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so `git describe` resolves the tag
fetch-depth: 0 # full history so git describe resolves the tag

- uses: actions/setup-go@v5
with:
Expand All @@ -26,24 +26,11 @@ jobs:
- name: Run tests
run: make test-ci

- name: Build all binaries
run: make build-all

- name: Generate checksums
run: |
cd bin
sha256sum tasklin-* > checksums.txt
echo "--- checksums ---"
cat checksums.txt

- name: Create GitHub release and upload assets
uses: softprops/action-gh-release@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
files: |
bin/tasklin-linux-amd64
bin/tasklin-linux-arm64
bin/tasklin-darwin-amd64
bin/tasklin-darwin-arm64
bin/tasklin-windows-amd64.exe
bin/checksums.txt
generate_release_notes: true
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 70 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
version: 2

project_name: tasklin

before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
flags:
- -trimpath
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.buildDate={{.Date}}

archives:
- id: default
format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md

checksum:
name_template: checksums.txt
algorithm: sha256

brews:
- name: tasklin
homepage: "https://github.com/yamidaisuke/tasklin"
description: "Keyboard-driven CLI/TUI kanban board for personal project backlogs"
license: "MIT"
repository:
owner: yamidaisuke
name: tasklin
branch: main
token: "{{ .Env.GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
commit_msg_template: "chore: update Homebrew formula to {{ .Tag }}"
directory: Formula
install: |
bin.install "tasklin"
test: |
system "#{bin}/tasklin", "--version"

release:
github:
owner: yamidaisuke
name: tasklin
draft: false
generate_release_notes: true
21 changes: 21 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ make build-all # cross-compile for all platforms

Never use `go build .` directly — always use `make build` so ldflags (version, commit, buildDate) are injected correctly.

## Release & distribution

Releases are driven by GoReleaser (`.goreleaser.yaml`) via the `.github/workflows/release.yml` workflow. Push a `v*.*.*` tag to trigger it.

GoReleaser:
- Builds cross-platform binaries (darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, windows/amd64)
- Creates `.tar.gz` / `.zip` archives
- Generates `checksums.txt` (SHA-256)
- Creates the GitHub release
- Commits an updated `Formula/tasklin.rb` to `main` so the Homebrew tap is always current

Users install via Homebrew:
```sh
brew tap yamidaisuke/tasklin https://github.com/yamidaisuke/tasklin
brew install tasklin
```

`Formula/tasklin.rb` is auto-managed by GoReleaser — do not edit it by hand.

Version info is injected at link time via ldflags into `main.version`, `main.commit`, and `main.buildDate`. `cmd.Execute` accepts these as parameters and sets `rootCmd.Version` so `tasklin --version` works.

## Architecture

```
Expand Down
43 changes: 43 additions & 0 deletions Formula/tasklin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This file is managed by GoReleaser and updated automatically on each release.
# Do not edit by hand.
#
# Installation:
# brew tap yamidaisuke/tasklin https://github.com/yamidaisuke/tasklin
# brew install tasklin
class Tasklin < Formula
desc "Keyboard-driven CLI/TUI kanban board for personal project backlogs"
homepage "https://github.com/yamidaisuke/tasklin"
license "MIT"

on_macos do
on_arm do
url "https://github.com/yamidaisuke/tasklin/releases/download/v0.0.0/tasklin_darwin_arm64.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
end

on_intel do
url "https://github.com/yamidaisuke/tasklin/releases/download/v0.0.0/tasklin_darwin_amd64.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
end
end

on_linux do
on_arm do
url "https://github.com/yamidaisuke/tasklin/releases/download/v0.0.0/tasklin_linux_arm64.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
end

on_intel do
url "https://github.com/yamidaisuke/tasklin/releases/download/v0.0.0/tasklin_linux_amd64.tar.gz"
sha256 "0000000000000000000000000000000000000000000000000000000000000000"
end
end

def install
bin.install "tasklin"
end

test do
system "#{bin}/tasklin", "--version"
end
end
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ A lightweight, portable CLI tool for managing personal project backlogs. Data is

## Requirements

- Go 1.24+
- Go 1.24+ (source installs only)

---

## Installation

### Homebrew (macOS and Linux)

```sh
brew tap yamidaisuke/tasklin https://github.com/yamidaisuke/tasklin
brew install tasklin
```

### From source

```sh
Expand Down
7 changes: 6 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ var rootCmd = &cobra.Command{
RunE: runRoot,
}

func initVersion(version, commit, buildDate string) {
rootCmd.Version = fmt.Sprintf("%s (commit: %s, built: %s)", version, commit, buildDate)
}

func runRoot(cmd *cobra.Command, args []string) error {
cwd, err := os.Getwd()
if err != nil {
Expand Down Expand Up @@ -48,7 +52,8 @@ func runRoot(cmd *cobra.Command, args []string) error {
}

// Execute runs the root command.
func Execute() {
func Execute(version, commit, buildDate string) {
initVersion(version, commit, buildDate)
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
Expand Down
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ package main

import "github.com/frankcruz/tasklin/cmd"

var (
version = "dev"
commit = "unknown"
buildDate = "unknown"
)

func main() {
cmd.Execute()
cmd.Execute(version, commit, buildDate)
}
Loading