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
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CI

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

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Build
run: go build -o band ./cmd/band

- name: Test
run: go test ./... -v

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v7

security:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Run govulncheck
run: govulncheck ./...

docs-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Check for doc updates
run: |
BASE=${{ github.event.pull_request.base.sha }}
HEAD=${{ github.event.pull_request.head.sha }}
CHANGED=$(git diff --name-only "$BASE" "$HEAD")

CODE_CHANGED=false
DOCS_CHANGED=false

# Check if command surface or flags changed
if echo "$CHANGED" | grep -qE '^cmd/|^internal/cmdutil/'; then
CODE_CHANGED=true
fi

# Check if any docs were touched
if echo "$CHANGED" | grep -qE '^README\.md$|^AGENTS\.md$'; then
DOCS_CHANGED=true
fi

if [ "$CODE_CHANGED" = true ] && [ "$DOCS_CHANGED" = false ]; then
echo "::warning::Command code changed without documentation updates. If this PR adds, removes, or changes commands/flags, please update README.md and/or AGENTS.md."
fi
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write
packages: write

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Run tests
run: go test ./... -v

release:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

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

- name: Log in 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: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# General macOS
.DS_Store

# Local test helpers
bxml_server.py
callback_server.py

# Go build output
/band
dist/
*.test

# Documentation (generated)
docs/

# IDE/tooling
.serena/
.claude/
.obsidian/
.worktrees
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "2"

linters:
default: standard
disable:
- errcheck
79 changes: 79 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
version: 2

builds:
- main: ./cmd/band
binary: band
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w -X github.com/Bandwidth/cli/cmd.version={{.Version}}

archives:
- format: tar.gz
name_template: "band_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip

checksum:
name_template: "checksums.txt"

dockers:
- image_templates:
- "ghcr.io/bandwidth/cli:{{ .Version }}-amd64"
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
goarch: amd64
dockerfile: Dockerfile.goreleaser
- image_templates:
- "ghcr.io/bandwidth/cli:{{ .Version }}-arm64"
use: buildx
build_flag_templates:
- "--platform=linux/arm64"
goarch: arm64
dockerfile: Dockerfile.goreleaser

docker_manifests:
- name_template: "ghcr.io/bandwidth/cli:{{ .Version }}"
image_templates:
- "ghcr.io/bandwidth/cli:{{ .Version }}-amd64"
- "ghcr.io/bandwidth/cli:{{ .Version }}-arm64"
- name_template: "ghcr.io/bandwidth/cli:latest"
image_templates:
- "ghcr.io/bandwidth/cli:{{ .Version }}-amd64"
- "ghcr.io/bandwidth/cli:{{ .Version }}-arm64"

brews:
- repository:
owner: Bandwidth
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
pull_request:
enabled: true
base:
owner: Bandwidth
name: homebrew-tap
branch: main
homepage: "https://github.com/Bandwidth/cli"
description: "Bandwidth CLI — manage voice, messaging, numbers, and more from the command line"
license: "MIT"
install: |
bin.install "band"
test: |
system "#{bin}/band", "version"

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