Skip to content

Commit 6189fcb

Browse files
committed
Add goreleaser config
1 parent 6e55522 commit 6189fcb

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

.github/workflows/release.yml

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

.goreleaser.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
3+
project_name: tess
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- id: tess
11+
main: ./cmd
12+
env:
13+
- CGO_ENABLED=0
14+
goos: [darwin]
15+
goarch: [arm64]
16+
ldflags:
17+
- -s -w -X tess/internal.Version={{.Version}}
18+
19+
archives:
20+
- id: archive
21+
ids: [tess]
22+
formats: ['zip']
23+
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}_v{{ .Version }}'
24+
files:
25+
- README.md
26+
- LICENSE*
27+
28+
checksum:
29+
name_template: 'checksums_v{{ .Version }}.txt'
30+
31+
release:
32+
draft: false
33+
prerelease: false

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ Tess is a small CLI that pulls review information from the Lattice API and helps
1616
- Build: `make`
1717
- Run: `./bin/tess`
1818

19+
### Releases
20+
21+
- Tags drive releases. Create a tag like `v1.2.3` and push it; GitHub Actions runs GoReleaser to build macOS binaries for arm64 and amd64 and attach zipped artifacts to the release.
22+
- Artifacts are named `tess_darwin_<arch>_v<version>.zip` with a checksums file.
23+
- Version info is baked into the binary via ldflags and defaults to `dev` for non-release builds.
24+
1925
## Configuration
2026

2127
- Tess looks for a TOML file containing an API key.

internal/version.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package internal
2+
3+
// Version is set at build time via -ldflags. Default is "dev".
4+
var Version = "dev"

0 commit comments

Comments
 (0)