Skip to content

Commit ebcaabf

Browse files
committed
🎉 feat(apps): initial code with several guards
1 parent da3bbe7 commit ebcaabf

34 files changed

Lines changed: 2119 additions & 67 deletions
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: ci-main-release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: write
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
build:
20+
name: build
21+
runs-on: macos-latest
22+
steps:
23+
- name: checkout-repository
24+
uses: actions/checkout@v6
25+
with:
26+
submodules: recursive
27+
fetch-depth: 0
28+
29+
- name: setup-just
30+
uses: extractions/setup-just@v3
31+
with:
32+
just-version: "1.46.0"
33+
34+
- name: setup-go
35+
uses: actions/setup-go@v6
36+
with:
37+
go-version-file: go.mod
38+
39+
- name: build-and-test
40+
run: just build
41+
42+
release:
43+
runs-on: macos-latest
44+
if: ${{ github.ref_type == 'tag' }}
45+
needs: build
46+
concurrency:
47+
group: release-${{ github.repository_id }}
48+
cancel-in-progress: true
49+
steps:
50+
- name: checkout-repository
51+
uses: actions/checkout@v6
52+
with:
53+
submodules: recursive
54+
fetch-depth: 0
55+
56+
- name: setup-just
57+
uses: extractions/setup-just@v3
58+
with:
59+
just-version: "1.46.0"
60+
61+
- name: setup-go
62+
uses: actions/setup-go@v6
63+
with:
64+
go-version-file: go.mod
65+
66+
- name: run-goreleaser
67+
uses: goreleaser/goreleaser-action@v6
68+
with:
69+
version: latest
70+
args: release --clean
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ __pycache__/
1818
# Documentation build output
1919
site/
2020

21+
# temporary files
22+
temp/
23+
bin/
24+
2125
# IDE
2226
.idea/
2327
.vscode/

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
run:
2+
timeout: 2m
3+
4+
linters:
5+
default: standard
6+
7+
version: '2'

.goreleaser.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
version: 2
2+
3+
project_name: yak
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
- go test ./...
9+
10+
builds:
11+
- id: yak
12+
binary: yak
13+
main: ./cmd/yak
14+
env:
15+
- CGO_ENABLED=0
16+
goos:
17+
- linux
18+
- darwin
19+
- windows
20+
goarch:
21+
- amd64
22+
- arm64
23+
ldflags:
24+
- -s -w
25+
- -X github.com/anadinema/yak/internal/version.Version={{.Version}}
26+
- -X github.com/anadinema/yak/internal/version.Commit={{.Commit}}
27+
- -X github.com/anadinema/yak/internal/version.Date={{.Date}}
28+
29+
archives:
30+
- id: default
31+
formats: [tar.gz]
32+
format_overrides:
33+
- goos: windows
34+
formats: [zip]
35+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
36+
37+
checksum:
38+
name_template: "checksums.txt"
39+
40+
release:
41+
github:
42+
owner: anadinema
43+
name: yak
44+
45+
homebrew_casks:
46+
- name: yak
47+
ids:
48+
- yak
49+
repository:
50+
owner: anadinema
51+
name: homebrew-tap
52+
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
53+
homepage: "https://yak.anadinema.dev"
54+
description: "Yet Another AWS Kit — AWS SSO and credential management"
55+
license: MIT
56+
binaries: ["yak"]
57+
generate_completions_from_executable:
58+
executable: "bin/yak"
59+
args:
60+
- completion
61+
shell_parameter_format: cobra
62+
shells:
63+
- bash
64+
- zsh
65+
- fish
66+
url:
67+
verified: github.com/anadinema/yak

Justfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
BINARY := "yak"
2+
CMD_PATH := "./cmd/yak"
3+
INSTALL := env_var("HOME") + "/.local/bin"
4+
5+
default:
6+
@just --list
7+
8+
build:
9+
go build -o bin/{{BINARY}} {{CMD_PATH}}
10+
11+
install: build
12+
mkdir -p {{INSTALL}}
13+
cp bin/{{BINARY}} {{INSTALL}}/{{BINARY}}
14+
15+
clean:
16+
rm -rf bin/
17+
18+
test:
19+
go test ./...
20+
21+
lint:
22+
golangci-lint run ./...
23+
24+
tidy:
25+
go mod tidy
26+
27+
fmt:
28+
golangci-lint fmt ./...
29+
30+
fmt-check:
31+
golangci-lint fmt --diff ./...

cmd/yak/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "github.com/anadinema/yak/internal/cmd"
4+
5+
func main() {
6+
cmd.Execute()
7+
}

docs/commands/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Commands
22

3-
yak provides a focused set of commands for AWS account and credential management. For anything yak doesn't handle, enable [passthrough](../guides/shell-integration.md#passthrough) to forward commands to the AWS CLI transparently.
3+
yak provides a focused set of commands for AWS account and credential management.
44

55
| Command | Description |
66
|-------------------------------|-----------------------------------------------|

docs/config/examples/toml-env.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ config_path = "~/.aws/config"
1818
[secrets]
1919
cache_ttl = 60 # minutes, 0 = no cache
2020

21-
[passthrough]
22-
enabled = false
23-
cli_binary_path = ""
24-
2521
[safeguards]
2622
enabled = true
2723
protected_accounts = ["prod", "mgmt"]

docs/config/examples/toml-op.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ config_path = "~/.aws/config"
2323
[secrets]
2424
cache_ttl = 60 # minutes, 0 = no cache
2525

26-
[passthrough]
27-
enabled = false
28-
cli_binary_path = ""
29-
3026
[safeguards]
3127
enabled = true
3228
protected_accounts = ["prod", "mgmt"]

docs/config/examples/yaml-env.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ aws:
1616
secrets:
1717
cache_ttl: 60
1818

19-
passthrough:
20-
enabled: false
21-
cli_binary_path: ""
22-
2319
safeguards:
2420
enabled: true
2521
protected_accounts: [prod, mgmt]

0 commit comments

Comments
 (0)