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
17 changes: 17 additions & 0 deletions .agents/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

curl -fsSL https://mise.run/bash | sh

"$HOME/.local/bin/mise" trust
"$HOME/.local/bin/mise" install --locked \
actionlint \
go \
"go:golang.org/x/vuln/cmd/govulncheck" \
gofumpt \
golangci-lint \
"github:dhth/terminal-control" \
yamlfmt

git config push.autoSetupRemote true
3 changes: 3 additions & 0 deletions .amp/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"amp.git.commit.ampThread.enabled": false
}
77 changes: 55 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,25 @@ jobs:
code:
- "cmd/**"
- "internal/**"
- "tests/**"
- "**/*.go"
- "go.*"
- "mise.toml"
- "mise.lock"
- ".golangci.yml"
- "main.go"
- ".github/actions/**"
- ".github/workflows/main.yml"
deps:
- "go.mod"
- "go.sum"
- "mise.toml"
- "mise.lock"
- ".github/workflows/main.yml"
release:
- ".goreleaser.yml"
- "mise.toml"
- "mise.lock"
- ".github/workflows/main.yml"
workflows:
- ".github/workflows/**.yml"
Expand All @@ -51,7 +58,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dhth/composite-actions/.github/actions/lint-go@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: go golangci-lint
- name: Lint
run: mise run lint

build:
needs: changes
Expand All @@ -62,12 +74,28 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: go
- name: Build
run: mise run build

test:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: go build
run: go build -v ./...
install_args: go
- name: Test
run: mise run test

lint-yaml:
needs: changes
Expand All @@ -76,7 +104,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: dhth/composite-actions/.github/actions/lint-yaml@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: yamlfmt
- name: Lint YAML
run: mise run lint:yaml

lint-workflows:
needs: changes
Expand All @@ -85,35 +118,35 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: dhth/composite-actions/.github/actions/lint-actions@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: actionlint
- name: Lint workflows
run: mise run lint:actions

release-check:
needs: changes
if: ${{ needs.changes.outputs.release == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
install_args: go goreleaser
- name: Release check
uses: goreleaser/goreleaser-action@v7
with:
version: 'v2.9.0'
args: check
run: mise run release:check

vulncheck:
needs: changes
if: ${{ needs.changes.outputs.deps == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: govulncheck
run: govulncheck ./...
install_args: go go:golang.org/x/vuln/cmd/govulncheck
- name: Vulnerability check
run: mise run vulncheck
77 changes: 55 additions & 22 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ jobs:
code:
- "cmd/**"
- "internal/**"
- "tests/**"
- "**/*.go"
- "go.*"
- "mise.toml"
- "mise.lock"
- ".golangci.yml"
- "main.go"
- ".github/actions/**"
- ".github/workflows/pr.yml"
deps:
- "go.mod"
- "go.sum"
- "mise.toml"
- "mise.lock"
- ".github/workflows/pr.yml"
release:
- ".goreleaser.yml"
- "mise.toml"
- "mise.lock"
- ".github/workflows/pr.yml"
workflows:
- ".github/workflows/**.yml"
Expand All @@ -49,7 +56,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dhth/composite-actions/.github/actions/lint-go@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: go golangci-lint
- name: Lint
run: mise run lint

build:
needs: changes
Expand All @@ -60,12 +72,28 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: go
- name: Build
run: mise run build

test:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: go build
run: go build -v ./...
install_args: go
- name: Test
run: mise run test

lint-yaml:
needs: changes
Expand All @@ -74,7 +102,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: dhth/composite-actions/.github/actions/lint-yaml@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: yamlfmt
- name: Lint YAML
run: mise run lint:yaml

lint-workflows:
needs: changes
Expand All @@ -83,35 +116,35 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: dhth/composite-actions/.github/actions/lint-actions@main
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: actionlint
- name: Lint workflows
run: mise run lint:actions

release-check:
needs: changes
if: ${{ needs.changes.outputs.release == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
install_args: go goreleaser
- name: Release check
uses: goreleaser/goreleaser-action@v7
with:
version: 'v2.9.0'
args: check
run: mise run release:check

vulncheck:
needs: changes
if: ${{ needs.changes.outputs.deps == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: govulncheck
run: govulncheck ./...
install_args: go go:golang.org/x/vuln/cmd/govulncheck
- name: Vulnerability check
run: mise run vulncheck
17 changes: 5 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: Install Cosign
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v2.5.3'
- name: Release Binaries
uses: goreleaser/goreleaser-action@v7
with:
version: 'v2.11.2'
args: release --clean
install_args: go goreleaser cosign
- name: Release binaries
run: mise run release
env:
GITHUB_TOKEN: ${{secrets.GH_PAT}}
25 changes: 25 additions & 0 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: scan

on:
workflow_dispatch:
schedule:
- cron: '0 12 10 * *'

jobs:
virus-total:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
install_args: go goreleaser
- name: Build binaries
run: mise run release:build
- name: List binaries
run: |
ls -lh ./dist/mult_*/mult
- uses: dhth/composite-actions/.github/actions/scan-files@main
with:
files: './dist/mult_*/mult'
vt-api-key: ${{ secrets.VT_API_KEY }}
12 changes: 5 additions & 7 deletions .github/workflows/vulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Set up mise
uses: jdx/mise-action@v4
with:
go-version-file: 'go.mod'
- name: install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: govulncheck
run: govulncheck ./...
install_args: go go:golang.org/x/vuln/cmd/govulncheck
- name: Vulnerability check
run: mise run vulncheck
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
mult
.quickrun
cosign.key
Expand Down
12 changes: 1 addition & 11 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@ This file provides guidance to AI coding agents when working with code in this r

## Common Commands

All commands use `just` (task runner):

```bash
just build # go build -ldflags='-s -w' .
just run # go run .
just install # go install -ldflags='-s -w' .
just lint # golangci-lint run
just fmt # gofumpt -w .
```

Note: always use `just` to run commands.
Read `mise.toml` for available development tasks and tools.

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/dhth/mult

go 1.26.4
go 1.26.6

require (
charm.land/bubbles/v2 v2.1.0
Expand Down
Loading