Files
free-turn-proxy/Taskfile.yml
T
samosvalishe 9734b37f38 chore(deps): обновить зависимости и версии инструментов
pion/turn 5.0.12, pion/dtls 3.1.5, x/crypto 0.54.0, x/net 0.57.0 + indirect.
govulncheck v1.6.0, goreleaser v2.17.1, task 3.52.0.
2026-07-29 01:59:27 +03:00

116 lines
3.3 KiB
YAML

version: '3'
vars:
BINARIES: client server
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo dev
LDFLAGS: -s -w -checklinkname=0 -X main.version={{.VERSION}}
GOLANGCI_VERSION: v2.12.2
GOVULN_VERSION: v1.6.0
GORELEASER_VERSION: v2.17.1
TASK_VERSION: v3.52.0
tasks:
default:
cmds:
- task --list
silent: true
build:
desc: Build host binaries (client + server) to dist/
cmds:
- for: { var: BINARIES }
cmd: go build -ldflags "{{.LDFLAGS}}" -trimpath -o dist/{{.ITEM}} ./cmd/{{.ITEM}}
build:all:
desc: Cross-compile all targets via goreleaser snapshot
cmds:
- goreleaser release --snapshot --clean --skip=publish,sign
build:ios:
desc: Build iOS XCFramework to dist/Mobile.xcframework
platforms: [darwin]
cmds:
- rm -rf dist/Mobile.xcframework
- mkdir -p dist
- gomobile bind -target ios,iossimulator -ldflags "-checklinkname=0" -o dist/Mobile.xcframework ./mobile
build:android:
desc: Build Android Archive (AAR) to dist/mobile.aar
cmds:
- rm -rf dist/mobile.aar dist/mobile-sources.jar
- mkdir -p dist
- cmd: gomobile bind -target android -androidapi 21 -ldflags "-checklinkname=0" -o dist/mobile.aar ./mobile
platforms: [linux, darwin]
- cmd: |
powershell -NoProfile -Command '$env:JAVA_HOME = "C:\Program Files\Android\Android Studio\jbr"; $env:PATH = "$env:JAVA_HOME\bin;$env:PATH"; gomobile bind -target android -androidapi 21 -ldflags "-checklinkname=0" -o dist/mobile.aar ./mobile'
platforms: [windows]
test:
desc: Run unit tests with race detector
cmds:
- go test -race -count=1 ./...
test:cover:
desc: Run tests with coverage report (cover.html)
cmds:
- go test -race -count=1 -coverprofile=cover.out ./...
- go tool cover -html=cover.out -o cover.html
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run --timeout=5m ./...
fmt:
desc: Format code (gofmt + goimports)
cmds:
- gofmt -w .
- goimports -w .
fmt:check:
desc: Verify formatting (fails on diff)
cmds:
- cmd: |
out=$(gofmt -l .)
if [ -n "$out" ]; then
echo "Files need formatting:"
echo "$out"
exit 1
fi
vet:
desc: Run go vet
cmds:
- go vet ./...
vuln:
desc: Run govulncheck
cmds:
- govulncheck ./...
tidy:
desc: Tidy go.mod / go.sum
cmds:
- go mod tidy
ci:
desc: Run full CI suite locally (fmt-check, vet, lint, test, vuln)
deps: [fmt:check, vet, lint, test, vuln]
tools:install:
desc: Install dev tools (golangci-lint, govulncheck, goreleaser, goimports)
cmds:
- go install golang.org/x/tools/cmd/goimports@latest
- go install golang.org/x/vuln/cmd/govulncheck@{{.GOVULN_VERSION}}
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_VERSION}}
- go install github.com/goreleaser/goreleaser/v2@{{.GORELEASER_VERSION}}
clean:
desc: Remove build artifacts
cmds:
- cmd: rm -rf dist/ cover.out cover.html
platforms: [linux, darwin]
- cmd: powershell -Command "Remove-Item -Recurse -Force dist,cover.out,cover.html -ErrorAction SilentlyContinue"
platforms: [windows]