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

on:
push:
pull_request:

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

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

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

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

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- uses: golangci/golangci-lint-action@v6
with:
version: latest
46 changes: 8 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,15 @@ name: Release

on:
push:
branches: [master]
tags:
- "v*"

permissions:
contents: write

jobs:
test:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

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

release:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -32,28 +20,10 @@ jobs:
with:
go-version-file: go.mod

- uses: go-semantic-release/action@v1
id: semrel
- uses: goreleaser/goreleaser-action@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
changelog-generator-opt: "emojis=true"

- name: Build all platforms
if: steps.semrel.outputs.version != ''
run: |
mkdir -p dist
for platform in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64; do
os="${platform%/*}"
arch="${platform#*/}"
GOOS="$os" GOARCH="$arch" go build -o dist/awn ./cmd/awn
GOOS="$os" GOARCH="$arch" go build -o dist/awnd ./cmd/awnd
GOOS="$os" GOARCH="$arch" go build -o dist/awn-mcp ./cmd/awn-mcp
tar czf "dist/awn-${os}-${arch}.tar.gz" -C dist awn awnd awn-mcp
rm -f dist/awn dist/awnd dist/awn-mcp
done

- name: Upload release assets
if: steps.semrel.outputs.version != ''
version: "~> v2"
args: release --clean
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "v${{ steps.semrel.outputs.version }}" dist/awn-*.tar.gz
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
71 changes: 71 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: 2

project_name: awn

before:
hooks:
- go mod tidy

builds:
- id: awn
binary: awn
main: ./cmd/awn
goos:
- linux
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}}

- id: awnd
binary: awnd
main: ./cmd/awnd
goos:
- linux
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}}

- id: awn-mcp
binary: awn-mcp
main: ./cmd/awn-mcp
goos:
- linux
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}}

archives:
- id: default
builds:
- awn
- awnd
- awn-mcp
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
format: tar.gz

checksum:
name_template: "checksums.txt"
algorithm: sha256

brews:
- name: awn
ids:
- default
repository:
owner: Tom-De-Santa-FOSS
name: homebrew-tap
homepage: "https://github.com/tom/awn"
description: "AWN terminal session management CLI"
install: |
bin.install "awn"
bin.install "awnd"
bin.install "awn-mcp"
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
.PHONY: build daemon cli mcp clean test test-scripts test-all lint fmt

LDFLAGS := -ldflags "-s -w -X main.version=$(shell cat VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo none)"

build: daemon cli mcp

daemon:
go build -o bin/awnd ./cmd/awnd
go build $(LDFLAGS) -o bin/awnd ./cmd/awnd

cli:
go build -o bin/awn ./cmd/awn
go build $(LDFLAGS) -o bin/awn ./cmd/awn

mcp:
go build -o bin/awn-mcp ./cmd/awn-mcp
go build $(LDFLAGS) -o bin/awn-mcp ./cmd/awn-mcp

clean:
rm -rf bin/
Expand Down
Loading
Loading