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
49 changes: 49 additions & 0 deletions .claude/skills/development-workflow/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: development-workflow
description: Branch naming conventions, PR workflow, and development process for this repository
---

## Branch Naming Conventions

When starting work, create a branch from `main` using the appropriate prefix:

* `feat/<short-name>` - For new features (e.g., `feat/blob-replication`)
* `bug/<description>` - For bug fixes (e.g., `bug/redis-connection-timeout`)
* `doc/<description>` - For documentation changes (e.g., `doc/api-examples`)

## Development Workflow

1. **Create branch** from `main` with the appropriate prefix
2. **Do the work** - implement the feature, fix, or documentation
3. **Commit and push** - commit changes with descriptive messages, push to remote
4. **Create PR** - open a pull request targeting `main`
5. **Wait for CI** - ensure all pipelines pass
6. **Get review** - wait for code review approval
7. **Squash merge** - merge to `main` using squash merge

## Git Commands Reference

```bash
# Start a new feature
git checkout main
git pull origin main
git checkout -b feat/<short-name>

# After work is complete
git add <files>
git commit -m "feat: description of changes"
git push -u origin feat/<short-name>

# Create PR via GitHub CLI
gh pr create --base main --title "feat: description" --body "..."
```

## Commit Message Style

Follow conventional commits where appropriate:
* `feat:` - New feature
* `fix:` - Bug fix
* `doc:` or `docs:` - Documentation
* `refactor:` - Code refactoring
* `test:` - Adding or updating tests
* `chore:` - Maintenance tasks
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

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

- uses: actions/setup-go@v5
with:
go-version: "1.25"

- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest

test:
name: Test
runs-on: ubuntu-latest
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: "1.25"

- name: Run unit tests
run: go test -v $(go list ./... | grep -v /test/e2e) -race

build:
name: Container Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: "1.25"

- uses: ko-build/setup-ko@v0.9

- name: Build container image
run: ko build --local ./cmd/barnacle
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write
packages: write

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

- uses: actions/setup-go@v5
with:
go-version: "1.25"

- uses: ko-build/setup-ko@v0.9

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

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KO_DOCKER_REPO: ghcr.io/pdylanross/barnacle
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.dll
*.so
*.dylib
dist/

# Test binary, built with `go test -c`
*.test
Expand Down
69 changes: 69 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

version: 2

project_name: barnacle

builds:
- id: barnacle
main: ./cmd/barnacle
binary: barnacle
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64

kos:
- id: barnacle
main: ./cmd/barnacle
base_image: gcr.io/distroless/static-debian12:nonroot
repositories:
- ghcr.io/pdylanross/barnacle
platforms:
- linux/amd64
- linux/arm64
tags:
- "{{.Tag}}"
- "{{.Major}}.{{.Minor}}"
- "{{.Major}}"
- latest
labels:
org.opencontainers.image.title: barnacle
org.opencontainers.image.description: Distributed tiered OCI registry caching proxy
org.opencontainers.image.source: https://github.com/pdylanross/barnacle
org.opencontainers.image.version: "{{.Version}}"
org.opencontainers.image.revision: "{{.Commit}}"
org.opencontainers.image.licenses: Apache-2.0
creation_time: "{{.CommitTimestamp}}"
ko_data_creation_time: "{{.CommitTimestamp}}"
sbom: none

archives:
- id: default
formats:
- tar.gz
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

checksum:
name_template: "checksums.txt"

changelog:
use: github
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"

release:
github:
owner: pdylanross
name: barnacle
draft: false
prerelease: auto
name_template: "{{ .Tag }}"
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016-2026 Carlos Alexandro Becker

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading