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
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, "feat/**"]
pull_request:

permissions:
contents: read

env:
CGO_ENABLED: "0"

jobs:
test:
name: test (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
# Native runners, so tests run on each target, not just compile (D18 and ADR-0011: no Windows).
- target: linux/amd64
runner: ubuntu-24.04
- target: linux/arm64
runner: ubuntu-24.04-arm
- target: darwin/arm64
runner: macos-15
- target: darwin/amd64
runner: macos-15-intel
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
check-latest: true
- name: Check target
run: test "$(go env GOOS)/$(go env GOARCH)" = "${{ matrix.target }}"
- name: Build
run: make build
- name: Test
run: go test -timeout 5m ./...
- uses: actions/upload-artifact@v7
with:
name: atlas-${{ matrix.runner }}
path: bin/atlas
retention-days: 7

lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
check-latest: true
- uses: golangci/golangci-lint-action@v9
with:
version: v2.14.0
- name: go.mod is tidy
run: go mod tidy -diff
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

env:
CGO_ENABLED: "0"

jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
check-latest: true
- run: go test -timeout 5m ./...

release:
needs: test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
check-latest: true
- uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.atlas/
bin/
graphify-out/
dist/
45 changes: 45 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: "2"

run:
timeout: 5m

linters:
default: standard # errcheck, govet, ineffassign, staticcheck, unused
enable:
- bodyclose
- copyloopvar
- errorlint
- gosec
- misspell
- nolintlint
- revive
- unconvert
- unparam
settings:
gosec:
excludes:
# Project dot-dirs are 0755 like the desktop's create_dir_all; secrets
# live only in the 0600 session file.
- G301
nolintlint:
require-explanation: true
require-specific: true
exclusions:
presets:
- std-error-handling
rules:
# Tests may write fixtures with ordinary permissions and use fixed paths.
- path: _test\.go
linters: [gosec]
# The stores build queries from fixed column lists and "?" placeholders only.
- path: internal/(memory/record|capture/store)/
text: G202

formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/tryatlas/atlas-cli
54 changes: 54 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Release builds for v1: Linux and macOS, both architectures (D18, ADR-0011; no Windows). Pure Go, CGO_ENABLED=0.
# Run by .github/workflows/release.yml on a v* tag; `make snapshot` builds
# the same archives locally without publishing.
version: 2

project_name: atlas

before:
hooks:
- go mod tidy -diff

builds:
- id: atlas
main: ./cmd/atlas
binary: atlas
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{ .Version }}
targets:
- linux_amd64
- linux_arm64
- darwin_arm64
- darwin_amd64
mod_timestamp: "{{ .CommitTimestamp }}"

archives:
- id: atlas
formats: [tar.gz]
name_template: "atlas_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- README.md
- LICENSE*

checksum:
name_template: checksums.txt
algorithm: sha256

snapshot:
version_template: "{{ incpatch .Version }}-snapshot"

changelog:
use: git
sort: asc

release:
github:
owner: tryatlas
name: atlas-cli
draft: true
extra_files:
- glob: ./install.sh
Loading
Loading