diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ca94840..3cc1211 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,152 +1,110 @@
name: CI
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
permissions:
contents: read
-on:
- push:
- branches: [ "main" ]
- pull_request:
- branches: [ "main" ]
+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.5.0
+ TASK_VERSION: v3.40.0
jobs:
- check:
- name: Lint, fmt-check, and tests
+ lint:
+ name: Lint & format
runs-on: ubuntu-latest
steps:
- - name: Check out code
- uses: actions/checkout@v6
+ - uses: actions/checkout@v4.2.2
- - name: Set up Go
- uses: actions/setup-go@v6
+ - uses: actions/setup-go@v5.1.0
with:
- go-version: 'stable'
+ go-version: ${{ env.GO_VERSION }}
+ cache: true
- - name: Cache Go modules
- uses: actions/cache@v5
+ - uses: arduino/setup-task@v2.0.0
with:
- path: |
- ~/.cache/go-build
- ~/go/pkg/mod
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- restore-keys: |
- ${{ runner.os }}-go-
+ version: ${{ env.TASK_VERSION }}
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Run gofmt (check)
- run: |
- echo "Checking formatting with gofmt..."
- fmt_output=$(gofmt -l . || true)
- if [ -n "$fmt_output" ]; then
- echo "The following files need formatting:"
- echo "$fmt_output"
- echo "Run 'gofmt -w .' to fix."
- exit 1
- fi
+ - name: Format check
+ run: task fmt:check
- - name: Run golangci-lint
- uses: golangci/golangci-lint-action@v9
+ - name: Vet
+ run: task vet
+
+ - uses: golangci/golangci-lint-action@v9.2.1
with:
- version: latest
+ version: ${{ env.GOLANGCI_VERSION }}
args: --timeout=5m ./...
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ 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: |
- go test -race ./... -v
-
- build:
- name: Build binaries
+ run: task test
+
+ vuln:
+ name: govulncheck
runs-on: ubuntu-latest
- strategy:
- matrix:
- include:
- - goos: linux
- goarch: amd64
- cgo: 0
- - goos: darwin
- goarch: arm64
- cgo: 0
- - goos: android
- goarch: arm64
- cgo: 1
- api: 21
- - goos: android
- goarch: arm
- cgo: 1
- api: 21
- # you can add more (android/arm, windows, etc.) later
-
steps:
- - name: Check out code
- uses: actions/checkout@v6
+ - uses: actions/checkout@v4.2.2
+
+ - uses: actions/setup-go@v5.1.0
with:
- fetch-tags: true
+ go-version: ${{ env.GO_VERSION }}
+ cache: true
- - name: Set up Go
- uses: actions/setup-go@v6
+ - 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:
- go-version: 'stable'
+ fetch-depth: 0
- # Install Android NDK for android rows and expose ndk-path output
- - name: Setup Android NDK
- if: matrix.goos == 'android'
- id: setup-ndk
- uses: nttld/setup-ndk@v1
+ - uses: actions/setup-go@v5.1.0
with:
- ndk-version: r26d
- add-to-path: false
+ go-version: ${{ env.GO_VERSION }}
+ cache: true
- - name: Build
- env:
- GOOS: ${{ matrix.goos }}
- GOARCH: ${{ matrix.goarch }}
- CGO_ENABLED: ${{ matrix.cgo }}
- ANDROID_API: ${{ matrix.api }}
- ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- run: |
- echo "Building for $GOOS/$GOARCH (CGO_ENABLED=$CGO_ENABLED)"
-
- # If this is an Android build, point CC at the NDK toolchain clang
- if [ "$GOOS" = "android" ]; then
- if [ -z "$ANDROID_NDK_HOME" ]; then
- echo "ANDROID_NDK_HOME is not set – did setup-ndk run?"
- exit 1
- fi
-
- TOOLCHAIN_BIN="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin"
-
- if [ "$GOARCH" = "arm64" ]; then
- export CC="$TOOLCHAIN_BIN/aarch64-linux-android${ANDROID_API}-clang"
- elif [ "$GOARCH" = "arm" ]; then
- export CC="$TOOLCHAIN_BIN/armv7a-linux-androideabi${ANDROID_API}-clang"
- else
- echo "Unsupported ANDROID GOARCH=$GOARCH"
- exit 1
- fi
-
- echo "Using Android NDK CC=$CC"
- fi
-
- mkdir -p dist
-
- ext=""
- if [ "$GOOS" = "windows" ]; then
- ext=".exe"
- fi
-
- GOOS=$GOOS GOARCH=$GOARCH \
- go build -ldflags "-s -w -checklinkname=0" -trimpath \
- -o "dist/client-${GOOS}-${GOARCH}${ext}" \
- ./cmd/client
-
- GOOS=$GOOS GOARCH=$GOARCH \
- go build -ldflags "-s -w -checklinkname=0" -trimpath \
- -o "dist/server-${GOOS}-${GOARCH}${ext}" \
- ./cmd/server
-
- - name: Upload artifact
- uses: actions/upload-artifact@v6
+ - uses: goreleaser/goreleaser-action@v6.1.0
with:
- name: good-turn-${{ matrix.goos }}-${{ matrix.goarch }}
- path: dist/**
+ 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
diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml
deleted file mode 100644
index 2eee1c7..0000000
--- a/.github/workflows/issues.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: "Close Stale Issues"
-on:
- schedule:
- - cron: "0 0 * * 3"
- workflow_dispatch:
-
-jobs:
- stale:
- permissions:
- issues: write
- runs-on: ubuntu-latest
- steps:
- - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- stale-issue-message: >
- Привет! 👋
-
- Данный issue давно не обновлялся. Если в течение недели здесь не будет больше активности, issue будет закрыт.
-
- Спасибо!
- close-issue-message: "Issue был закрыт из-за отсутствия активности."
- days-before-stale: 120
- days-before-close: 7
- operations-per-run: 1000
- ascending: true
- enable-statistics: true
- stale-issue-label: "Stale"
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
new file mode 100644
index 0000000..58a7472
--- /dev/null
+++ b/.github/workflows/release-please.yml
@@ -0,0 +1,23 @@
+name: Release Please
+
+on:
+ push:
+ branches: [main]
+
+permissions:
+ contents: write
+ pull-requests: write
+
+concurrency:
+ group: release-please-${{ github.ref }}
+ cancel-in-progress: false
+
+jobs:
+ release-please:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: googleapis/release-please-action@v4.1.3
+ with:
+ config-file: release-please-config.json
+ manifest-file: .release-please-manifest.json
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9d4c0e2..7a00c81 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,345 +1,50 @@
name: Release
-permissions:
- contents: read
-
on:
push:
- branches:
- - main
- workflow_dispatch:
+ tags:
+ - 'v*.*.*'
+
+permissions:
+ contents: write
+ packages: write
+
+env:
+ GO_VERSION: "1.25.0"
+ GORELEASER_VERSION: v2.5.0
jobs:
- build:
- name: Build binaries
+ goreleaser:
+ name: GoReleaser
runs-on: ubuntu-latest
- strategy:
- matrix:
- include:
- - goos: linux
- goarch: amd64
- cgo: 0
- - goos: linux
- goarch: arm64
- cgo: 0
- - goos: linux
- goarch: 386
- cgo: 0
- - goos: linux
- goarch: arm
- goarm: "7"
- cgo: 0
- - goos: linux
- goarch: mipsle
- gomips: softfloat
- cgo: 0
- - goos: linux
- goarch: mips
- gomips: softfloat
- cgo: 0
- - goos: linux
- goarch: mips64le
- gomips: softfloat
- cgo: 0
- - goos: linux
- goarch: riscv64
- cgo: 0
- - goos: darwin
- goarch: amd64
- cgo: 0
- - goos: darwin
- goarch: arm64
- cgo: 0
- - goos: windows
- goarch: amd64
- cgo: 0
- - goos: windows
- goarch: arm64
- cgo: 0
- - goos: windows
- goarch: 386
- cgo: 0
- - goos: android
- goarch: arm64
- cgo: 1
- api: 21
- - goos: android
- goarch: arm
- cgo: 1
- api: 21
- - goos: freebsd
- goarch: amd64
- cgo: 0
-
steps:
- - name: Check out code
- uses: actions/checkout@v6
-
- - name: Set up Go
- uses: actions/setup-go@v6
- with:
- go-version: "stable"
-
- # Install Android NDK only for android rows
- - name: Setup Android NDK
- if: matrix.goos == 'android'
- id: setup-ndk
- uses: nttld/setup-ndk@v1
- with:
- ndk-version: r26d
- add-to-path: false
-
- - name: Build
- env:
- GOOS: ${{ matrix.goos }}
- GOARCH: ${{ matrix.goarch }}
- GOMIPS: ${{ matrix.gomips }}
- GOARM: ${{ matrix.goarm }}
- CGO_ENABLED: ${{ matrix.cgo }}
- ANDROID_API: ${{ matrix.api }}
- ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- VERSION: ${{ github.ref_name }}
- run: |
- echo "Building for $GOOS/$GOARCH${GOARM:+/arm$GOARM} (CGO_ENABLED=$CGO_ENABLED)"
-
- if [ "$GOOS" = "android" ]; then
- if [ -z "$ANDROID_NDK_HOME" ]; then
- echo "ANDROID_NDK_HOME is not set – did setup-ndk run?"
- exit 1
- fi
-
- TOOLCHAIN_BIN="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin"
-
- if [ "$GOARCH" = "arm64" ]; then
- export CC="$TOOLCHAIN_BIN/aarch64-linux-android${ANDROID_API}-clang"
- elif [ "$GOARCH" = "arm" ]; then
- export CC="$TOOLCHAIN_BIN/armv7a-linux-androideabi${ANDROID_API}-clang"
- else
- echo "Unsupported ANDROID GOARCH=$GOARCH"
- exit 1
- fi
-
- echo "Using Android NDK CC=$CC"
- fi
-
- mkdir -p dist
-
- # Set extension for windows
- if [ "${GOOS}" = "windows" ]; then
- EXT=.exe
- else
- EXT=
- fi
-
- GOOS=$GOOS GOARCH=$GOARCH GOARM=$GOARM GOMIPS=$GOMIPS \
- go build -ldflags "-s -w -checklinkname=0" -trimpath \
- -o "dist/client-${GOOS}-${GOARCH}${EXT}" \
- ./cmd/client
-
- GOOS=$GOOS GOARCH=$GOARCH GOARM=$GOARM GOMIPS=$GOMIPS \
- go build -ldflags "-s -w -checklinkname=0" -trimpath \
- -o "dist/server-${GOOS}-${GOARCH}${EXT}" \
- ./cmd/server
-
- - name: Upload artifact
- uses: actions/upload-artifact@v6
- with:
- name: good-turn-${{ matrix.goos }}-${{ matrix.goarch }}
- path: dist/**
-
- release:
- name: Create GitHub Release
- needs: build
- runs-on: ubuntu-latest
- outputs:
- should_release: ${{ steps.meta.outputs.should_release }}
- tag_name: ${{ steps.meta.outputs.tag_name }}
- permissions:
- contents: write
- steps:
- - name: Check out code
- uses: actions/checkout@v6
+ - uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- fetch-tags: true
- - name: Download build artifacts
- uses: actions/download-artifact@v7
+ - uses: actions/setup-go@v5.1.0
with:
- path: dist
+ go-version: ${{ env.GO_VERSION }}
+ cache: true
- - name: Prepare release metadata
- id: meta
- run: |
- LATEST_TAG="$(git tag -l | grep -E '^(v)?[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1 || true)"
- PREFIX=""
- BASE_VERSION="$LATEST_TAG"
+ - uses: docker/setup-qemu-action@v3.2.0
- if [ -z "$LATEST_TAG" ]; then
- BASE_VERSION="0.0.0"
- elif [ "${LATEST_TAG#v}" != "$LATEST_TAG" ]; then
- PREFIX="v"
- BASE_VERSION="${LATEST_TAG#v}"
- fi
+ - uses: docker/setup-buildx-action@v3.7.1
- IFS=. read -r MAJOR MINOR PATCH <<< "$BASE_VERSION"
-
- if [ -n "$LATEST_TAG" ]; then
- RANGE="$LATEST_TAG..HEAD"
- else
- RANGE="HEAD"
- fi
-
- COMMITS="$(git log --no-merges --format='%s' "$RANGE")"
- BUMP=""
-
- if printf '%s\n' "$COMMITS" | grep -Eiq '^break([(:! ]|$)'; then
- BUMP="major"
- MAJOR=$((MAJOR + 1))
- MINOR=0
- PATCH=0
- elif printf '%s\n' "$COMMITS" | grep -Eiq '^(feat|refactor)([(:! ]|$)'; then
- BUMP="minor"
- MINOR=$((MINOR + 1))
- PATCH=0
- elif printf '%s\n' "$COMMITS" | grep -Eiq '^fix([(:! ]|$)'; then
- BUMP="patch"
- PATCH=$((PATCH + 1))
- fi
-
- NEXT_VERSION="${MAJOR}.${MINOR}.${PATCH}"
- NEXT_TAG="${PREFIX}${NEXT_VERSION}"
-
- {
- echo "previous_tag=$LATEST_TAG"
- echo "range=$RANGE"
- echo "bump=$BUMP"
- echo "should_release=$([ -n "$BUMP" ] && echo true || echo false)"
- echo "tag_name=$NEXT_TAG"
- echo "release_name=$NEXT_TAG"
- echo "body_path=release-notes.md"
- } >> "$GITHUB_OUTPUT"
-
- - name: Generate release notes from commit messages
- id: notes
- if: steps.meta.outputs.should_release == 'true'
- env:
- PREVIOUS_TAG: ${{ steps.meta.outputs.previous_tag }}
- NEXT_TAG: ${{ steps.meta.outputs.tag_name }}
- BUMP: ${{ steps.meta.outputs.bump }}
- RANGE: ${{ steps.meta.outputs.range }}
- run: |
- strip_prefix() {
- sed -E 's/^(feat|fix|break|refactor)([(!:]|[[:space:]])+[[:space:]]*//I'
- }
-
- FEATURES="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^feat([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
- REFACTORS="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^refactor([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
- FIXES="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^fix([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
- BREAKING="$(git log --no-merges --format='%s (%h)' "$RANGE" | grep -Ei '^break([(:! ]|$)' | strip_prefix | LC_ALL=C sort -f || true)"
-
- {
- echo "body_path=release-notes.md"
- } >> "$GITHUB_OUTPUT"
-
- {
- if [ -n "$BREAKING" ]; then
- echo "### Breaking Changes"
- echo
- printf '%s\n' "$BREAKING" | sed 's/^/- /'
- echo
- fi
-
- if [ -n "$FEATURES" ]; then
- echo "### Features"
- echo
- printf '%s\n' "$FEATURES" | sed 's/^/- /'
- echo
- fi
-
- if [ -n "$REFACTORS" ]; then
- echo "### Refactoring"
- echo
- printf '%s\n' "$REFACTORS" | sed 's/^/- /'
- echo
- fi
-
- if [ -n "$FIXES" ]; then
- echo "### Bug Fixes"
- echo
- printf '%s\n' "$FIXES" | sed 's/^/- /'
- echo
- fi
- } > release-notes.md
-
- - name: Create Release
- if: steps.meta.outputs.should_release == 'true'
- uses: softprops/action-gh-release@v2
- with:
- # upload every file in dist/ including nested files
- files: |
- dist/**
- tag_name: ${{ steps.meta.outputs.tag_name }}
- target_commitish: ${{ github.sha }}
- name: ${{ steps.meta.outputs.release_name }}
- body_path: ${{ steps.meta.outputs.body_path }}
- overwrite_files: true
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Skip release when no semantic commit is found
- if: steps.meta.outputs.should_release != 'true'
- run: |
- echo "No new semantic release created."
- echo "Add a commit starting with break, feat, fix, or refactor after the latest tag."
-
- docker:
- name: Publish Docker image
- needs: release
- if: needs.release.outputs.should_release == 'true'
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- steps:
- - name: Check out code
- uses: actions/checkout@v6
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v4
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v4
-
- - name: Prepare image name
- id: image
- env:
- REPOSITORY: ${{ github.repository }}
- run: |
- echo "name=ghcr.io/$(echo "$REPOSITORY" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
-
- - name: Log in to GitHub Container Registry
- uses: docker/login-action@v4
+ - name: Log in to GHCR
+ uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- - name: Extract Docker metadata
- id: meta
- uses: docker/metadata-action@v6
- with:
- images: ${{ steps.image.outputs.name }}
- tags: |
- type=raw,value=latest
- type=raw,value=${{ needs.release.outputs.tag_name }}
+ - name: Install syft (SBOM)
+ uses: anchore/sbom-action/download-syft@v0.17.7
- - name: Build and push Docker image
- uses: docker/build-push-action@v7
+ - uses: goreleaser/goreleaser-action@v6.1.0
with:
- context: .
- file: ./Dockerfile
- platforms: linux/amd64,linux/arm64
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
+ distribution: goreleaser
+ version: ${{ env.GORELEASER_VERSION }}
+ args: release --clean
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
new file mode 100644
index 0000000..eb2ecab
--- /dev/null
+++ b/.goreleaser.yaml
@@ -0,0 +1,199 @@
+# GoReleaser config: https://goreleaser.com
+version: 2
+
+project_name: btp
+
+before:
+ hooks:
+ - go mod download
+
+builds:
+ # Standard client/server builds — pure Go, no CGO.
+ - id: client
+ main: ./cmd/client
+ binary: client
+ flags:
+ - -trimpath
+ ldflags:
+ - -s -w -checklinkname=0 -X main.version={{.Version}}
+ env:
+ - CGO_ENABLED=0
+ targets:
+ - linux_amd64
+ - linux_arm64
+ - linux_386
+ - linux_arm_7
+ - linux_mipsle_softfloat
+ - linux_mips_softfloat
+ - linux_mips64le_softfloat
+ - linux_riscv64
+ - darwin_amd64
+ - darwin_arm64
+ - windows_amd64
+ - windows_arm64
+ - windows_386
+ - freebsd_amd64
+
+ - id: server
+ main: ./cmd/server
+ binary: server
+ flags:
+ - -trimpath
+ ldflags:
+ - -s -w -checklinkname=0 -X main.version={{.Version}}
+ env:
+ - CGO_ENABLED=0
+ targets:
+ - linux_amd64
+ - linux_arm64
+ - linux_386
+ - linux_arm_7
+ - linux_mipsle_softfloat
+ - linux_mips_softfloat
+ - linux_mips64le_softfloat
+ - linux_riscv64
+ - darwin_amd64
+ - darwin_arm64
+ - windows_amd64
+ - windows_arm64
+ - windows_386
+ - freebsd_amd64
+
+ # Android client only. Pure Go (CGO=0), packaged as native .so name
+ # for use as Android native library (JNI / standalone shipment).
+ - id: client-android
+ main: ./cmd/client
+ binary: libvkturn2.so
+ no_unique_dist_dir: false
+ flags:
+ - -trimpath
+ ldflags:
+ - -s -w -checklinkname=0 -X main.version={{.Version}}
+ env:
+ - CGO_ENABLED=0
+ targets:
+ - android_arm64
+ - android_arm
+
+archives:
+ # Default archives for non-Android platforms: tar.gz / zip with bundled binary.
+ - id: default
+ ids:
+ - client
+ - server
+ name_template: >-
+ {{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}
+ {{- with .Arm }}v{{ . }}{{ end }}
+ {{- with .Mips }}-{{ . }}{{ end }}
+ format_overrides:
+ - goos: windows
+ formats: [zip]
+ files:
+ - LICENSE*
+ - README*
+
+ # Android: ship the .so binary directly (no archive wrapper), with
+ # arch suffix so arm64 and arm coexist on the release page.
+ - id: android
+ ids:
+ - client-android
+ formats: [binary]
+ name_template: "libvkturn2-{{ .Version }}-android-{{ .Arch }}"
+
+checksum:
+ name_template: checksums.txt
+
+sboms:
+ - artifacts: archive
+
+snapshot:
+ version_template: "{{ incpatch .Version }}-snapshot-{{ .ShortCommit }}"
+
+changelog:
+ use: github
+ sort: asc
+ groups:
+ - title: "Breaking Changes"
+ regexp: '^.*?break(\(.+?\))??!?:.+$'
+ order: 0
+ - title: "Features"
+ regexp: '^.*?feat(\(.+?\))??!?:.+$'
+ order: 10
+ - title: "Bug Fixes"
+ regexp: '^.*?fix(\(.+?\))??!?:.+$'
+ order: 20
+ - title: "Performance"
+ regexp: '^.*?perf(\(.+?\))??!?:.+$'
+ order: 30
+ - title: "Refactoring"
+ regexp: '^.*?refactor(\(.+?\))??!?:.+$'
+ order: 40
+ - title: "Other"
+ order: 999
+ filters:
+ exclude:
+ - '^docs:'
+ - '^test:'
+ - '^chore:'
+ - '^ci:'
+ - '^style:'
+ - 'Merge pull request'
+ - 'Merge branch'
+
+release:
+ github:
+ owner: samosvalishe
+ name: btp
+ prerelease: auto
+ mode: replace
+ draft: false
+ name_template: "{{ .ProjectName }} {{ .Version }}"
+
+dockers:
+ - id: server-amd64
+ ids:
+ - server
+ image_templates:
+ - "ghcr.io/samosvalishe/btp:{{ .Version }}-amd64"
+ dockerfile: Dockerfile.goreleaser
+ use: buildx
+ goos: linux
+ goarch: amd64
+ build_flag_templates:
+ - "--platform=linux/amd64"
+ - "--label=org.opencontainers.image.source=https://github.com/samosvalishe/btp"
+ - "--label=org.opencontainers.image.version={{ .Version }}"
+ - "--label=org.opencontainers.image.revision={{ .FullCommit }}"
+ - "--label=org.opencontainers.image.created={{ .Date }}"
+ extra_files:
+ - docker/entrypoint.sh
+
+ - id: server-arm64
+ ids:
+ - server
+ image_templates:
+ - "ghcr.io/samosvalishe/btp:{{ .Version }}-arm64"
+ dockerfile: Dockerfile.goreleaser
+ use: buildx
+ goos: linux
+ goarch: arm64
+ build_flag_templates:
+ - "--platform=linux/arm64"
+ - "--label=org.opencontainers.image.source=https://github.com/samosvalishe/btp"
+ - "--label=org.opencontainers.image.version={{ .Version }}"
+ - "--label=org.opencontainers.image.revision={{ .FullCommit }}"
+ - "--label=org.opencontainers.image.created={{ .Date }}"
+ extra_files:
+ - docker/entrypoint.sh
+
+docker_manifests:
+ - name_template: "ghcr.io/samosvalishe/btp:{{ .Version }}"
+ image_templates:
+ - "ghcr.io/samosvalishe/btp:{{ .Version }}-amd64"
+ - "ghcr.io/samosvalishe/btp:{{ .Version }}-arm64"
+
+ - name_template: "ghcr.io/samosvalishe/btp:latest"
+ skip_push: "{{ .Prerelease }}"
+ image_templates:
+ - "ghcr.io/samosvalishe/btp:{{ .Version }}-amd64"
+ - "ghcr.io/samosvalishe/btp:{{ .Version }}-arm64"
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
new file mode 100644
index 0000000..e18ee07
--- /dev/null
+++ b/.release-please-manifest.json
@@ -0,0 +1,3 @@
+{
+ ".": "0.0.0"
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..41ccc72
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Changelog
+
+All notable changes to this project are documented here.
+
+This file is maintained automatically by
+[Release Please](https://github.com/googleapis/release-please) based on
+[Conventional Commits](https://www.conventionalcommits.org/).
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 9b945c9..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,21 +0,0 @@
-FROM golang:1.25-alpine AS builder
-
-WORKDIR /build
-
-COPY . .
-RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o server ./cmd/server
-
-FROM alpine:3.23
-
-RUN apk add --no-cache ca-certificates tzdata
-
-WORKDIR /app
-
-COPY docker/entrypoint.sh .
-COPY --from=builder /build/server .
-RUN sed -i 's/\r$//' entrypoint.sh && chmod +x entrypoint.sh
-
-EXPOSE 56000/udp
-EXPOSE 56000/tcp
-
-ENTRYPOINT ["./entrypoint.sh"]
diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser
new file mode 100644
index 0000000..ab9a3b6
--- /dev/null
+++ b/Dockerfile.goreleaser
@@ -0,0 +1,20 @@
+# Thin runtime image. Built by GoReleaser using a pre-compiled server binary.
+# See .goreleaser.yaml (dockers section) for the build context.
+FROM alpine:3.23
+
+RUN apk add --no-cache ca-certificates tzdata
+
+WORKDIR /app
+
+# GoReleaser places the server binary at the build root, and any files
+# listed in `extra_files` (entrypoint.sh) are also placed in the context root.
+COPY server /app/server
+COPY docker/entrypoint.sh /app/entrypoint.sh
+
+RUN sed -i 's/\r$//' /app/entrypoint.sh \
+ && chmod +x /app/entrypoint.sh /app/server
+
+EXPOSE 56000/udp
+EXPOSE 56000/tcp
+
+ENTRYPOINT ["/app/entrypoint.sh"]
diff --git a/README.md b/README.md
index d840141..29b6ff1 100644
--- a/README.md
+++ b/README.md
@@ -8,17 +8,62 @@
## О проекте
-**btp** - туннель UDP/TCP через TURN-реле VK Calls. Клиент берёт временные TURN-учётки из ссылки на звонок и гонит ваш
-трафик (WireGuard, Xray/VLESS) до сервера на VPS поверх DTLS.
+**btp** — туннель UDP/TCP через TURN-реле VK Calls. Клиент берёт временные TURN-учётки из ссылки на звонок и гонит ваш трафик (WireGuard, Xray/VLESS) до сервера на VPS поверх DTLS.
## Быстрый старт
+См. [docs/quickstart.md](docs/quickstart.md). Полная документация — в [docs/](docs/README.md).
+## Разработка
-