Skip to content

Commit ab56cd3

Browse files
committed
initial commit
0 parents  commit ab56cd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+8735
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help improve kl
4+
title: ''
5+
labels: bug
6+
assignees: robinovitch61
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...' page
16+
2. Enter '...' key strokes
17+
3. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Please complete the following information:**
26+
- OS: [e.g. iOS, Windows]
27+
- Terminal [e.g. iterm2]
28+
- Version [e.g. v0.5.1 or how it was installed if "built from source"]
29+
- Configuration options used, e.g. cli arguments, env vars, and/or `.kl.yaml` file
30+
31+
32+
**Additional context**
33+
Add any other context about the problem here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for kl
4+
title: ''
5+
labels: enhancement
6+
assignees: robinovitch61
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/build.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
- name: Install Nix
17+
uses: cachix/install-nix-action@v23
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.22'
22+
- name: Run gofmt
23+
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v4
26+
with:
27+
distribution: goreleaser
28+
version: latest
29+
args: build --snapshot --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
33+
AUR_KEY: ${{ secrets.AUR_KEY }}
34+
NUR_PACKAGES_GITHUB_TOKEN: ${{ secrets.NUR_PACKAGES_GITHUB_TOKEN }}
35+
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}

.github/workflows/golangci-lint.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Go CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: 1.22
22+
23+
- name: Cache Go modules
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/go/pkg/mod
28+
~/.cache/go-build
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
33+
- name: Install golangci-lint
34+
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
35+
36+
- name: Run golangci-lint
37+
run: golangci-lint run
38+
39+
test:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Go
46+
uses: actions/setup-go@v4
47+
with:
48+
go-version: 1.22
49+
50+
- name: Cache Go modules
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
~/go/pkg/mod
55+
~/.cache/go-build
56+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
57+
restore-keys: |
58+
${{ runner.os }}-go-
59+
60+
- name: Build the code
61+
run: go build ./...
62+
63+
- name: Run tests
64+
run: go test ./...

.github/workflows/release.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Expects secrets:
2+
# GITHUB_TOKEN - token for the repository, provided in GitHub Action
3+
# HOMEBREW_TAP_GITHUB_TOKEN - token for the homebrew tap repository, must be set
4+
# AUR_KEY - key for the AUR repository, must be set
5+
# NUR_PACKAGES_GITHUB_TOKEN - token for the NUR packages repository, must be set
6+
7+
name: release
8+
9+
on:
10+
create:
11+
tags:
12+
- v*
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: write
17+
18+
env:
19+
CHOCOLATEY_VERSION: 2.2.2
20+
21+
jobs:
22+
goreleaser:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
- name: Install Nix
30+
uses: cachix/install-nix-action@v23
31+
- name: Install Snapcraft & Chocolatey
32+
# from https://github.com/twpayne/chezmoi/blob/5293b40b48e678c461d68d06b635010173cac970/.github/workflows/main.yml#L154C1-L167C38
33+
run: |
34+
sudo apt-get --quiet update
35+
sudo apt-get --no-install-suggests --no-install-recommends --quiet --yes install musl-tools snapcraft
36+
# https://github.com/goreleaser/goreleaser/issues/1715
37+
# https://bugs.launchpad.net/snapcraft/+bug/1889741
38+
mkdir -p "${HOME}/.cache/snapcraft/download"
39+
mkdir -p "${HOME}/.cache/snapcraft/stage-packages"
40+
mkdir -p /opt/chocolatey
41+
wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey"
42+
echo '#!/bin/bash' >> /usr/local/bin/choco
43+
echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco
44+
chmod +x /usr/local/bin/choco
45+
- name: Set up Go
46+
uses: actions/setup-go@v4
47+
with:
48+
go-version: '1.22'
49+
- name: Run gofmt
50+
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
51+
- name: Run GoReleaser
52+
uses: goreleaser/goreleaser-action@v4
53+
with:
54+
distribution: goreleaser
55+
version: latest
56+
args: release --clean
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
60+
AUR_KEY: ${{ secrets.AUR_KEY }}
61+
NUR_PACKAGES_GITHUB_TOKEN: ${{ secrets.NUR_PACKAGES_GITHUB_TOKEN }}
62+
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
.DS_Store
3+
*.log
4+
*.txt

.goreleaser.yaml

+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
version: 2
2+
3+
project_name: kl
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- binary: kl
11+
env:
12+
- CGO_ENABLED=0
13+
goos:
14+
- darwin
15+
- freebsd
16+
- linux
17+
- windows
18+
19+
archives:
20+
- format_overrides:
21+
- goos: windows
22+
format: zip
23+
name_template: >-
24+
{{ .ProjectName }}_{{ .Version }}_
25+
{{- if eq .Os "darwin" }}Darwin
26+
{{- else if eq .Os "linux" }}Linux
27+
{{- else if eq .Os "windows" }}Windows
28+
{{- else }}{{ .Os }}{{ end }}_
29+
{{- if eq .Arch "amd64" }}x86_64
30+
{{- else if eq .Arch "386" }}i386
31+
{{- else }}{{ .Arch }}{{ end }}
32+
33+
checksum:
34+
name_template: 'checksums.txt'
35+
36+
snapshot:
37+
name_template: "{{ incpatch .Version }}-next"
38+
39+
changelog:
40+
sort: asc
41+
filters:
42+
exclude:
43+
- '^docs:'
44+
- '^test:'
45+
46+
universal_binaries:
47+
- replace: true
48+
49+
release:
50+
github:
51+
owner: robinovitch61
52+
name: kl
53+
54+
brews:
55+
- name: kl
56+
homepage: https://github.com/robinovitch61/kl
57+
description: "An interactive Kubernetes log viewer for your terminal."
58+
directory: Formula
59+
commit_author:
60+
name: "Leo Robinovitch"
61+
62+
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
63+
repository:
64+
owner: robinovitch61
65+
name: homebrew-tap
66+
branch: main
67+
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
68+
69+
aurs:
70+
- name: "kl-bin"
71+
homepage: "https://github.com/robinovitch61/kl"
72+
description: "An interactive Kubernetes log viewer for your terminal."
73+
maintainers:
74+
- "Leo Robinovitch <[email protected]>"
75+
license: "MIT"
76+
private_key: "{{ .Env.AUR_KEY }}"
77+
git_url: "ssh://[email protected]/kl-bin.git"
78+
depends:
79+
- "glibc"
80+
commit_author:
81+
name: "Leo Robinovitch"
82+
83+
skip_upload: auto
84+
85+
nix:
86+
- name: kl
87+
commit_author:
88+
name: "Leo Robinovitch"
89+
90+
homepage: "https://github.com/robinovitch61/kl"
91+
description: "An interactive Kubernetes log viewer for your terminal."
92+
license: "mit" # must be lowercase
93+
skip_upload: auto
94+
repository:
95+
owner: robinovitch61
96+
name: nur-packages
97+
branch: main
98+
token: "{{ .Env.NUR_PACKAGES_GITHUB_TOKEN }}"
99+
100+
winget:
101+
- name: kl
102+
publisher: robinovitch61
103+
license: MIT
104+
copyright: "Leo Robinovitch"
105+
homepage: https://github.com/robinovitch61/kl
106+
short_description: "An interactive Kubernetes log viewer for your terminal."
107+
package_identifier: "robinovitch61.kl"
108+
repository:
109+
owner: "robinovitch61"
110+
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
111+
name: winget-pkgs
112+
branch: "{{.ProjectName}}-{{.Version}}"
113+
pull_request:
114+
enabled: true
115+
draft: false
116+
base:
117+
owner: microsoft
118+
name: winget-pkgs
119+
branch: master
120+
121+
scoops:
122+
- repository:
123+
owner: "robinovitch61"
124+
name: scoop-bucket
125+
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
126+
commit_author:
127+
name: goreleaserbot
128+
129+
homepage: https://github.com/robinovitch61/kl
130+
description: "An interactive Kubernetes log viewer for your terminal."
131+
license: MIT
132+
133+
chocolateys:
134+
- owners: "Leo Robinovitch"
135+
authors: "Leo Robinovitch"
136+
project_url: https://github.com/robinovitch61/kl
137+
url_template: "https://github.com/robinovitch61/kl/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
138+
license_url: https://github.com/robinovitch61/kl/blob/main/LICENSE
139+
require_license_acceptance: false
140+
project_source_url: https://github.com/robinovitch61/kl
141+
docs_url: https://github.com/robinovitch61/kl/blob/main/README.md
142+
bug_tracker_url: https://github.com/robinovitch61/kl/issues
143+
tags: "kl kubernetes k9s kubectl"
144+
summary: "An interactive Kubernetes log viewer for your terminal."
145+
description: |
146+
# An interactive Kubernetes log viewer for your terminal.
147+
148+
https://github.com/robinovitch61/kl for installation and usage.
149+
release_notes: "https://github.com/robinovitch61/kl/releases/tag/v{{ .Version }}"
150+
api_key: "{{ .Env.CHOCOLATEY_API_KEY }}"
151+
source_repo: "https://push.chocolatey.org/"
152+
skip_publish: false
153+
154+
gomod:
155+
proxy: true

0 commit comments

Comments
 (0)