Skip to content

Commit 21b0f47

Browse files
committed
add github workflows
1 parent b7ff104 commit 21b0f47

File tree

3 files changed

+222
-0
lines changed

3 files changed

+222
-0
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.24.1'
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'npm'
31+
cache-dependency-path: web/frontend/package-lock.json
32+
33+
- name: Install frontend dependencies
34+
run: cd web/frontend && npm ci
35+
36+
- name: Run tests
37+
run: go test -v ./tests/...
38+
39+
- name: Run GoReleaser
40+
uses: goreleaser/goreleaser-action@v6
41+
with:
42+
distribution: goreleaser
43+
version: latest
44+
args: release --clean
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
version: 2
2+
3+
# Git configuration
4+
git:
5+
# What should be used to sort tags when gathering the current and previous
6+
# tags if there are more than one tag in the same commit.
7+
tag_sort: -version:refname
8+
9+
# Before hooks - run before building
10+
before:
11+
hooks:
12+
# Build the frontend first (similar to your build.sh)
13+
- cd web/frontend && npm ci && npm run build
14+
# Copy frontend dist to internal/web for embedding
15+
- rm -rf internal/web/dist
16+
- cp -r web/frontend/dist internal/web/
17+
18+
# Build configuration
19+
builds:
20+
- id: scriberr
21+
main: ./cmd/server/main.go
22+
binary: scriberr
23+
env:
24+
- CGO_ENABLED=0
25+
goos:
26+
- linux
27+
- darwin
28+
- windows
29+
goarch:
30+
- amd64
31+
- arm64
32+
# Build flags
33+
ldflags:
34+
- -s -w
35+
- -X main.version={{ .Version }}
36+
- -X main.commit={{ .Commit }}
37+
- -X main.date={{ .Date }}
38+
39+
# Archive configuration
40+
archives:
41+
- id: default
42+
format: tar.gz
43+
# Use zip for windows
44+
format_overrides:
45+
- goos: windows
46+
format: zip
47+
name_template: >-
48+
{{ .ProjectName }}_
49+
{{- title .Os }}_
50+
{{- if eq .Arch "amd64" }}x86_64
51+
{{- else if eq .Arch "386" }}i386
52+
{{- else }}{{ .Arch }}{{ end }}
53+
{{- if .Arm }}v{{ .Arm }}{{ end }}
54+
files:
55+
- README.md
56+
- LICENSE*
57+
- CHANGELOG*
58+
59+
# Checksum configuration
60+
checksum:
61+
name_template: 'checksums.txt'
62+
63+
# Snapshot configuration
64+
snapshot:
65+
name_template: "{{ incpatch .Version }}-next"
66+
67+
# Changelog configuration
68+
changelog:
69+
sort: asc
70+
use: github
71+
filters:
72+
exclude:
73+
- "^docs:"
74+
- "^test:"
75+
- "^ci:"
76+
- "^chore:"
77+
- "^style:"
78+
- "^refactor:"
79+
groups:
80+
- title: Features
81+
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
82+
order: 0
83+
- title: Bug Fixes
84+
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
85+
order: 1
86+
- title: Others
87+
order: 999
88+
89+
# GitHub Release configuration
90+
release:
91+
github:
92+
owner: rishikanthc
93+
name: Scriberr
94+
draft: false
95+
prerelease: auto
96+
mode: replace
97+
header: |
98+
## Scriberr {{ .Tag }}
99+
100+
Welcome to this new release of Scriberr!
101+
102+
### Installation
103+
104+
#### Homebrew (macOS/Linux)
105+
```bash
106+
brew tap rishikanthc/scriberr
107+
brew install scriberr
108+
```
109+
110+
#### Manual Installation
111+
Download the appropriate archive for your platform below, extract it, and place the binary in your PATH.
112+
113+
# Homebrew Tap configuration
114+
brews:
115+
- repository:
116+
owner: rishikanthc
117+
name: homebrew-scriberr
118+
branch: main
119+
ids:
120+
- scriberr
121+
homepage: https://github.com/rishikanthc/Scriberr
122+
description: "Audio transcription service using WhisperX with speaker diarization"
123+
license: MIT
124+
folder: Formula
125+
dependencies:
126+
127+
type: optional
128+
install: |
129+
bin.install "scriberr"
130+
131+
# Create example config
132+
(etc/"scriberr").mkpath
133+
(etc/"scriberr/.env.example").write <<~EOS
134+
# Scriberr Configuration
135+
HOST=localhost
136+
PORT=8080
137+
JWT_SECRET=change-this-in-production
138+
DATABASE_PATH=./data/scriberr.db
139+
UPLOAD_DIR=./data/uploads
140+
TRANSCRIPT_DIR=./data/transcripts
141+
PYTHON_PATH=/opt/homebrew/bin/python3
142+
UV_PATH=/opt/homebrew/bin/uv
143+
WHISPERX_ENV=./data/whisperx-env
144+
DEFAULT_API_KEY=scriberr-dev-key
145+
EOS
146+
test: |
147+
system "#{bin}/scriberr", "--version"
148+
caveats: |
149+
Scriberr requires Python 3.11+ for transcription features.
150+
151+
To get started:
152+
1. Copy the example config: cp #{etc}/scriberr/.env.example .env
153+
2. Edit .env to configure your settings
154+
3. Run: scriberr
155+
156+
The web interface will be available at http://localhost:8080

cmd/server/main.go

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

33
import (
44
"context"
5+
"flag"
6+
"fmt"
57
"log"
68
"net/http"
79
"os"
@@ -21,6 +23,13 @@ import (
2123
"github.com/gin-gonic/gin"
2224
)
2325

26+
// Version information (set by GoReleaser)
27+
var (
28+
version = "dev"
29+
commit = "none"
30+
date = "unknown"
31+
)
32+
2433
// @title Scriberr API
2534
// @version 1.0
2635
// @description Audio transcription service using WhisperX
@@ -46,6 +55,17 @@ import (
4655
// @description JWT token with Bearer prefix
4756

4857
func main() {
58+
// Handle version flag
59+
var showVersion = flag.Bool("version", false, "Show version information")
60+
flag.Parse()
61+
62+
if *showVersion {
63+
fmt.Printf("Scriberr %s\n", version)
64+
fmt.Printf("Commit: %s\n", commit)
65+
fmt.Printf("Built: %s\n", date)
66+
os.Exit(0)
67+
}
68+
4969
// Load configuration
5070
cfg := config.Load()
5171

0 commit comments

Comments
 (0)