Files
free-turn-proxy/Taskfile.yml
T
samosvalishe 3ee9087323 ci: переезд на Task + GoReleaser + Release Please
- Taskfile.yml: build/test/lint/fmt/vuln/ci/tools, единая точка входа
- .goreleaser.yaml: 13 целевых платформ + Android .so + GHCR multi-arch образы
- release-please: автогенерация PR с CHANGELOG и тегов из conventional commits
- Dockerfile.goreleaser: тонкий alpine-runtime, бинарь подкладывает GoReleaser
  (старый multistage Dockerfile удалён)
- ci.yml: разнесён на lint/test/vuln/build-snapshot, версии actions запинены,
  добавлены concurrency и env-блок
- release.yml: 345 строк matrix-сборок сведены к запуску goreleaser на tag push
- golangci-lint v1.65.0 (несуществующая) → v2.12.2; путь /v2/cmd/, action
  v6.1.1 → v9.2.1
- cmd/{client,server}: var version для -ldflags -X main.version, лог версии
  при старте
- удалены: .github/workflows/issues.yml, docs/build.md (устарела после Task)
2026-05-23 00:25:57 +03:00

96 lines
2.4 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.1.4
GORELEASER_VERSION: v2.5.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
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]