Skip to content

Commit 974c61a

Browse files
cailmdaleyclaude
andcommitted
chore: add goreleaser and release workflow
- Add .goreleaser.yml for cross-platform builds (darwin/linux, amd64/arm64) - Add release workflow triggered on version tags - Add version info (--version flag) populated via ldflags - Update .gitignore for felt-linux and dist/ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 087aa7d commit 974c61a

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: go.mod
23+
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v6
26+
with:
27+
distribution: goreleaser
28+
version: "~> v2"
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Binaries (root only, not internal/felt/)
22
/felt
3+
/felt-linux
34
*.exe
45

6+
# goreleaser
7+
dist/
8+
59
# Local state (these are user-specific)
610
.felt/
711
.dots/

.goreleaser.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
- go generate ./...
7+
8+
builds:
9+
- env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- darwin
14+
goarch:
15+
- amd64
16+
- arm64
17+
ldflags:
18+
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
19+
20+
archives:
21+
- format: tar.gz
22+
name_template: >-
23+
{{ .ProjectName }}_
24+
{{- title .Os }}_
25+
{{- if eq .Arch "amd64" }}x86_64
26+
{{- else if eq .Arch "386" }}i386
27+
{{- else }}{{ .Arch }}{{ end }}
28+
format_overrides:
29+
- goos: windows
30+
format: zip
31+
32+
changelog:
33+
sort: asc
34+
filters:
35+
exclude:
36+
- "^docs:"
37+
- "^test:"
38+
39+
brews:
40+
- repository:
41+
owner: cailmdaley
42+
name: homebrew-tap
43+
directory: Formula
44+
homepage: https://github.com/cailmdaley/felt
45+
description: DAG-native task tracker. Markdown files with dependencies.
46+
license: MIT
47+
test: |
48+
system "#{bin}/felt", "--help"
49+
install: |
50+
bin.install "felt"

cmd/root.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import (
1010

1111
var jsonOutput bool
1212

13+
// SetVersionInfo sets version info from main (populated via ldflags)
14+
func SetVersionInfo(version, commit, date string) {
15+
rootCmd.Version = version
16+
}
17+
1318
var rootCmd = &cobra.Command{
1419
Use: "felt",
1520
Short: "DAG-native markdown task tracker",

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ package main
22

33
import "github.com/cailmdaley/felt/cmd"
44

5+
// version info set via ldflags during build
6+
var (
7+
version = "dev"
8+
commit = "none"
9+
date = "unknown"
10+
)
11+
512
func main() {
13+
cmd.SetVersionInfo(version, commit, date)
614
cmd.Execute()
715
}

0 commit comments

Comments
 (0)