Skip to content

Commit 8cc2d99

Browse files
committed
chore: update release config to match countdown project setup
- Update .goreleaser.yml to use homebrew_casks with environment variables - Configure to publish through topfunky/homebrew-tap repository - Add CGO_ENABLED=0 and ldflags for version injection - Update archive templates and checksum algorithm - Update .github/workflows/release.yml to use HOMEBREW_TAP_TOKEN - Simplify Go version to stable and GoReleaser to latest
1 parent 0c847c3 commit 8cc2d99

2 files changed

Lines changed: 48 additions & 32 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*' # Triggers on tags starting with 'v' (e.g., v1.0.0)
6+
- "v*"
77

88
permissions:
9-
contents: write # Required for creating releases
10-
pull-requests: write # Required for updating homebrew tap
9+
contents: write
1110

1211
jobs:
1312
release:
1413
runs-on: ubuntu-latest
1514
steps:
16-
- name: Checkout code
15+
- name: Checkout
1716
uses: actions/checkout@v6
1817
with:
19-
fetch-depth: 0 # Required for goreleaser to generate changelog
18+
fetch-depth: 0
2019

2120
- name: Set up Go
2221
uses: actions/setup-go@v6
2322
with:
24-
go-version: '1.23'
23+
go-version: stable
24+
25+
- name: Run tests
26+
run: go test -v ./...
2527

2628
- name: Run GoReleaser
2729
uses: goreleaser/goreleaser-action@v6
2830
with:
2931
distribution: goreleaser
30-
version: '~> v2' # Use GoReleaser v2.x (matches v6 default)
32+
version: latest
3133
args: release --clean
3234
env:
3335
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

.goreleaser.yml

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,64 @@
1-
# GoReleaser configuration for tiny-timer
2-
# See https://goreleaser.com for documentation
3-
41
version: 2
52

63
project_name: tiny-timer
74

5+
before:
6+
hooks:
7+
- go mod tidy
8+
- go test ./...
9+
810
builds:
911
- id: tiny-timer
12+
main: .
1013
binary: tiny-timer
14+
env:
15+
- CGO_ENABLED=0
1116
goos:
1217
- linux
1318
- darwin
1419
- windows
1520
goarch:
1621
- amd64
1722
- arm64
18-
main: .
23+
ldflags:
24+
- -s -w
25+
- -X main.version={{.Version}}
1926

2027
archives:
2128
- id: default
22-
format: tar.gz
23-
format_overrides:
24-
- goos: windows
25-
format: zip
26-
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
29+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
30+
files:
31+
- README.md
32+
- LICENSE*
2733

2834
checksum:
29-
name_template: 'checksums.txt'
30-
31-
snapshot:
32-
name_template: "{{ .Tag }}-next"
35+
name_template: "checksums.txt"
36+
algorithm: sha256
3337

3438
changelog:
3539
sort: asc
3640
filters:
3741
exclude:
38-
- '^docs:'
39-
- '^test:'
42+
- "^docs:"
43+
- "^test:"
44+
- "^chore:"
4045

41-
brews:
46+
homebrew_casks:
4247
- name: tiny-timer
43-
tap: topfunky/tap
44-
homepage: https://github.com/topfunky/tiny-timer
45-
description: A simple command-line Pomodoro timer with an animated progress bar
46-
license: MIT
47-
test: |
48-
system "#{bin}/tiny-timer --help"
49-
install: |
50-
bin.install "tiny-timer"
48+
repository:
49+
owner: "{{ .Env.GITHUB_REPOSITORY_OWNER }}"
50+
name: homebrew-tap
51+
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
52+
homepage: "https://github.com/{{ .Env.GITHUB_REPOSITORY }}"
53+
description: "A simple command-line Pomodoro timer with an animated progress bar"
54+
url:
55+
verified: "github.com/{{ .Env.GITHUB_REPOSITORY }}"
56+
binaries:
57+
- tiny-timer
58+
hooks:
59+
post:
60+
install: |
61+
if OS.mac?
62+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/tiny-timer"]
63+
end
64+
skip_upload: auto

0 commit comments

Comments
 (0)