Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.24'

- uses: golangci/golangci-lint-action@v6
with:
args: --timeout=5m

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.24'

- name: Go vet
run: go vet ./...

- name: Go test
run: go test -race -count=1 ./...

build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.24'

- name: Go build
run: go build ./...

- name: Docker build
run: docker build -t splitter .
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version: '1.24'

- name: Extract version
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Build binaries
run: |
VERSION=${{ steps.version.outputs.VERSION }}
LDFLAGS="-s -w -X github.com/user/splitter/cmd.Version=${VERSION}"

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="${LDFLAGS}" -o splitter-${VERSION}-linux-amd64 .
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="${LDFLAGS}" -o splitter-${VERSION}-linux-arm64 .
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="${LDFLAGS}" -o splitter-${VERSION}-darwin-amd64 .
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="${LDFLAGS}" -o splitter-${VERSION}-darwin-arm64 .

- name: Generate checksums
run: |
sha256sum splitter-* > checksums.txt

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: SPLITTER ${{ steps.version.outputs.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
files: |
splitter-*
checksums.txt

docker:
name: Docker
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
63 changes: 63 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Go build artifacts
/bin/
*.exe
*.exe~
*.dll
*.so
*.dylib

# Compiled binary (generated by `go build`)
/splitter

# Go test artifacts
*.test
*.out
*.prof
coverage.txt

# Go vendor (if ever used)
/vendor/

# Dependency directories
/node_modules/

# Runtime / generated files
*.log
*.pid
/tmp/splitter/
force_new_circuit.sh

# Tor runtime files
/control_auth_cookie
/cached-certs
/cached-microdesc-consensus
/cached-microdescs
/cached-microdescs.new
/lock
/state/
/keys/

# HAProxy runtime
/haproxy.cfg.generated

# IDE / editor
.idea/
.vscode/
*.swp
*.swo
*~

# OS artifacts
.DS_Store
Thumbs.db

# Environment / secrets
.env
.env.*
!.env.example

# OpenCode AI development environment files
opencode.json
.opencode/
prompts/
.agents/
Loading
Loading