Skip to content

Commit d099d03

Browse files
authored
Initial release v0.1.0 (#1)
* Add project configuration and dependencies * Add SomaFM CLI application Terminal-based music player with TUI, audio streaming, and persistent configuration. * Add CI/CD workflows * Add GoReleaser configuration Builds for macOS and Windows. Linux excluded (requires CGO). * Add README * Add demo assets
1 parent 832ed6a commit d099d03

31 files changed

+7113
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
3+
go.sum -diff

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Install ALSA dev libraries
17+
run: sudo apt-get update && sudo apt-get install -y libasound2-dev
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: "1.24"
23+
24+
- name: Build
25+
run: go build -v ./...
26+
27+
- name: Test
28+
run: go test -v ./...
29+
30+
lint:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Install ALSA dev libraries
37+
run: sudo apt-get update && sudo apt-get install -y libasound2-dev
38+
39+
- name: Set up Go
40+
uses: actions/setup-go@v5
41+
with:
42+
go-version: "1.24"
43+
44+
- name: golangci-lint
45+
uses: golangci/golangci-lint-action@v6
46+
with:
47+
version: latest
48+
49+
goreleaser-check:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
57+
- name: Set up Go
58+
uses: actions/setup-go@v5
59+
with:
60+
go-version: "1.24"
61+
62+
- name: Check GoReleaser config
63+
uses: goreleaser/goreleaser-action@v6
64+
with:
65+
distribution: goreleaser
66+
version: "~> v2"
67+
args: check

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: "1.24"
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6
27+
with:
28+
distribution: goreleaser
29+
version: "~> v2"
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
### Build ###
2+
/somafm
3+
/somafm-*
4+
/out/
5+
/dist/
6+
7+
### Go ###
8+
*.exe
9+
*.exe~
10+
*.dll
11+
*.so
12+
*.dylib
13+
*.test
14+
*.out
15+
go.work
16+
go.work.sum
17+
vendor/
18+
19+
### Secrets ###
20+
.env
21+
.idea/

.goreleaser.yaml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
3+
4+
version: 2
5+
6+
project_name: somafm
7+
8+
before:
9+
hooks:
10+
- go mod tidy
11+
12+
builds:
13+
- id: somafm
14+
main: ./cmd/somafm
15+
binary: somafm
16+
env:
17+
- CGO_ENABLED=0
18+
goos:
19+
- linux
20+
- darwin
21+
- windows
22+
goarch:
23+
- amd64
24+
- arm64
25+
ldflags:
26+
- -s -w
27+
- -X github.com/glebovdev/somafm-cli/internal/config.AppVersion={{.Version}}
28+
ignore:
29+
- goos: windows
30+
goarch: arm64
31+
# Linux requires CGO for audio (oto/v3)
32+
- goos: linux
33+
goarch: amd64
34+
- goos: linux
35+
goarch: arm64
36+
37+
archives:
38+
- id: default
39+
formats:
40+
- tar.gz
41+
format_overrides:
42+
- goos: windows
43+
formats:
44+
- zip
45+
name_template: >-
46+
{{ .ProjectName }}_
47+
{{- .Version }}_
48+
{{- .Os }}_
49+
{{- .Arch }}
50+
files:
51+
- README.md
52+
- LICENSE
53+
54+
checksum:
55+
name_template: "checksums.txt"
56+
57+
changelog:
58+
sort: asc
59+
filters:
60+
exclude:
61+
- "^docs:"
62+
- "^test:"
63+
- "^chore:"
64+
- "Merge pull request"
65+
- "Merge branch"
66+
67+
release:
68+
github:
69+
owner: glebovdev
70+
name: somafm-cli
71+
draft: false
72+
prerelease: auto
73+
name_template: "v{{.Version}}"
74+
header: |
75+
## SomaFM CLI v{{.Version}}
76+
77+
A terminal-based music player for SomaFM radio stations.
78+
footer: |
79+
---
80+
{{- if .PreviousTag }}
81+
82+
**Full Changelog**: https://github.com/glebovdev/somafm-cli/compare/{{ .PreviousTag }}...{{ .Tag }}
83+
{{- end }}
84+
85+
## Installation
86+
87+
### macOS
88+
```bash
89+
brew install glebovdev/tap/somafm
90+
```
91+
92+
### Windows
93+
```powershell
94+
scoop bucket add glebovdev https://github.com/glebovdev/scoop-bucket
95+
scoop install somafm
96+
```
97+
98+
### Linux
99+
```bash
100+
go install github.com/glebovdev/somafm-cli/cmd/somafm@latest
101+
```
102+
Pre-built binaries require CGO. Use `go install` which builds with your system's audio libraries.
103+
104+
# Homebrew cask configuration (replaces deprecated brews)
105+
scoops:
106+
- name: somafm
107+
repository:
108+
owner: glebovdev
109+
name: scoop-bucket
110+
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
111+
homepage: "https://github.com/glebovdev/somafm-cli"
112+
description: "Terminal-based music player for SomaFM radio stations"
113+
license: MIT
114+
115+
homebrew_casks:
116+
- name: somafm
117+
repository:
118+
owner: glebovdev
119+
name: homebrew-tap
120+
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
121+
directory: Casks
122+
url:
123+
verified: github.com/glebovdev/somafm-cli
124+
homepage: "https://github.com/glebovdev/somafm-cli"
125+
description: "Terminal-based music player for SomaFM radio stations"
126+
license: "MIT"
127+
commit_author:
128+
name: goreleaserbot
129+
email: bot@goreleaser.com
130+
binaries:
131+
- somafm
132+
hooks:
133+
post:
134+
install: |
135+
if OS.mac?
136+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/somafm"]
137+
end

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 Ilya Glebov
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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
BINARY_NAME=somafm
2+
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null | sed 's/^v//' || echo "dev")
3+
LDFLAGS=-ldflags "-X github.com/glebovdev/somafm-cli/internal/config.AppVersion=$(VERSION)"
4+
5+
build:
6+
go build $(LDFLAGS) -o $(BINARY_NAME) cmd/somafm/main.go
7+
8+
# Linux cross-compilation requires CGO for ALSA audio. Use GitHub Actions for Linux builds.
9+
build-all:
10+
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-darwin-amd64 cmd/somafm/main.go
11+
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY_NAME)-darwin-arm64 cmd/somafm/main.go
12+
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-windows-amd64.exe cmd/somafm/main.go
13+
14+
test:
15+
go test ./...
16+
17+
clean:
18+
go clean
19+
rm -f $(BINARY_NAME) $(BINARY_NAME)-*
20+
21+
.PHONY: build build-all test clean

0 commit comments

Comments
 (0)