Проход lint (52 → 0): - vkauth/token: переименовать затенённый err (govet shadow x3) - udprelay/loop: явный _ = conn.Close() (errcheck x2) - captcha/manual: ReadHeaderTimeout + html.EscapeString (G112, G705) - proxy/tcpfwd: хелпер nonNegUint64 для байтовых счётчиков io.Copy (G115) - proxy/bondclient, wire/bondframe: bounds-проверки на len->uint16/uint32 - wire/srtpmimicry: задокументирована усечка RTP seq mod 2^16 - dnsdial/doh: bounds-проверка + binary.BigEndian.PutUint16 - captcha/slider: clamp luma до 255 перед конверсией uint8 - vkauth/types: обоснованный nolint для публичных учёток VK SDK Новый пакет internal/randx — Intn/IntN/Float64 на crypto/rand, drop-in замена math/rand. Мигрированы все места antifingerprint-jitter (~22) в captcha, slider, namegen, vkauth, udprelay. GoReleaser: - bump GORELEASER_VERSION v2.5.0 → v2.15.4 в Taskfile и обоих CI-workflow; текущий синтаксис .goreleaser.yaml (archives.ids, format_overrides.formats) требует v2.8+ - миграция dockers + docker_manifests → dockers_v2 (единый блок, multi-platform buildx); Dockerfile.goreleaser использует конвенцию ARG TARGETPLATFORM
111 lines
2.4 KiB
YAML
111 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
GO_VERSION: "1.25.0"
|
|
GOLANGCI_VERSION: v2.12.2
|
|
GOVULN_VERSION: v1.1.4
|
|
GORELEASER_VERSION: v2.15.4
|
|
TASK_VERSION: v3.40.0
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint & format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
|
|
- uses: actions/setup-go@v5.1.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- uses: arduino/setup-task@v2.0.0
|
|
with:
|
|
version: ${{ env.TASK_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Format check
|
|
run: task fmt:check
|
|
|
|
- name: Vet
|
|
run: task vet
|
|
|
|
- uses: golangci/golangci-lint-action@v9.2.1
|
|
with:
|
|
version: ${{ env.GOLANGCI_VERSION }}
|
|
args: --timeout=5m ./...
|
|
|
|
test:
|
|
name: Test (race)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
|
|
- uses: actions/setup-go@v5.1.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- uses: arduino/setup-task@v2.0.0
|
|
with:
|
|
version: ${{ env.TASK_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Run tests
|
|
run: task test
|
|
|
|
vuln:
|
|
name: govulncheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
|
|
- uses: actions/setup-go@v5.1.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- name: Install govulncheck
|
|
run: go install golang.org/x/vuln/cmd/govulncheck@${{ env.GOVULN_VERSION }}
|
|
|
|
- run: govulncheck ./...
|
|
|
|
build-snapshot:
|
|
name: Snapshot build (all targets)
|
|
runs-on: ubuntu-latest
|
|
needs: [lint, test]
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@v5.1.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache: true
|
|
|
|
- uses: goreleaser/goreleaser-action@v6.1.0
|
|
with:
|
|
distribution: goreleaser
|
|
version: ${{ env.GORELEASER_VERSION }}
|
|
args: release --snapshot --clean --skip=publish,sign,docker,announce
|
|
|
|
- uses: actions/upload-artifact@v4.4.3
|
|
with:
|
|
name: snapshot-dist
|
|
path: dist/
|
|
retention-days: 7
|