Skip to content

Commit 3458a5b

Browse files
authored
feat: initial release. (#1)
1 parent 04c7a93 commit 3458a5b

31 files changed

+1295
-45
lines changed

.github/renovate.json

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"extends": [
3+
"config:best-practices"
4+
],
5+
"osvVulnerabilityAlerts": true,
6+
"vulnerabilityAlerts": {
7+
"labels": [
8+
"security"
9+
],
10+
"automerge": true,
11+
"assignees": [
12+
"@ekristen"
13+
]
14+
},
15+
"packageRules": [
16+
{
17+
"matchUpdateTypes": [
18+
"minor",
19+
"patch"
20+
],
21+
"matchCurrentVersion": "!/^0/",
22+
"automerge": true
23+
},
24+
{
25+
"matchDatasources": [
26+
"go",
27+
"docker"
28+
],
29+
"groupName": "kubernetes",
30+
"groupSlug": "kubernetes",
31+
"matchPackageNames": [
32+
"bitnami/kubectl",
33+
"/^k8s.io//"
34+
]
35+
},
36+
{
37+
"matchManagers": [
38+
"dockerfile"
39+
],
40+
"matchUpdateTypes": [
41+
"pin",
42+
"digest"
43+
],
44+
"automerge": true,
45+
"labels": [
46+
"patch"
47+
]
48+
},
49+
{
50+
"groupName": "golang",
51+
"groupSlug": "golang",
52+
"matchPackageNames": [
53+
"/^golang.*/"
54+
]
55+
},
56+
{
57+
"matchFileNames": [
58+
".github/workflows/*.yml"
59+
],
60+
"matchDepTypes": [
61+
"action"
62+
],
63+
"matchCurrentVersion": "!/^0/",
64+
"automerge": true,
65+
"labels": [
66+
"bot/skip-changelog"
67+
]
68+
},
69+
{
70+
"matchManagers": [
71+
"gomod"
72+
],
73+
"matchDepTypes": [
74+
"indirect"
75+
],
76+
"enabled": true
77+
}
78+
],
79+
"customManagers": [
80+
{
81+
"customType": "regex",
82+
"fileMatch": [
83+
".*.go$"
84+
],
85+
"matchStrings": [
86+
"\"(?<currentValue>.*)\" // renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s"
87+
],
88+
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
89+
},
90+
{
91+
"customType": "regex",
92+
"fileMatch": [
93+
"^.github/workflows/.*"
94+
],
95+
"matchStrings": [
96+
"go-version: (?<currentValue>.*?).x\n"
97+
],
98+
"depNameTemplate": "golang",
99+
"datasourceTemplate": "docker"
100+
}
101+
]
102+
}

.github/workflows/commit-lint.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: commit-lint
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
14+
jobs:
15+
commit-lint:
16+
name: commit-lint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
20+
- uses: wagoid/commitlint-github-action@3d28780bbf0365e29b144e272b2121204d5be5f3 # v6

.github/workflows/docs.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- docs/**
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
deploy:
25+
runs-on: ubuntu-latest
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
steps:
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
31+
- name: setup pages
32+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
33+
- name: setup python
34+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
35+
with:
36+
python-version: 3.x
37+
- name: setup cache
38+
run: |
39+
echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
40+
- name: handle cache
41+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
42+
with:
43+
key: mkdocs-material-${{ env.cache_id }}
44+
path: .cache
45+
restore-keys: |
46+
mkdocs-material-
47+
- name: install mkdocs material
48+
run: |
49+
pip install mkdocs-material
50+
- name: run mkdocs material
51+
run: |
52+
mkdocs build
53+
- name: upload artifact
54+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
55+
with:
56+
# Upload entire repository
57+
path: public/
58+
- name: deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

.github/workflows/golangci-lint.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: golangci-lint
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
golangci-lint:
12+
name: golangci-lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
16+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
17+
with:
18+
go-version: '1.21.x'
19+
cache: false
20+
- name: golangci-lint
21+
uses: golangci/golangci-lint-action@v6

.github/workflows/goreleaser.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: goreleaser
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- next
9+
tags:
10+
- "*"
11+
release:
12+
types:
13+
- published
14+
15+
permissions:
16+
contents: write
17+
packages: write
18+
id-token: write
19+
20+
jobs:
21+
release:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
25+
if: github.event_name == 'pull_request'
26+
with:
27+
fetch-depth: 0
28+
ref: ${{ github.event.pull_request.head.ref }}
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
30+
if: github.event_name != 'pull_request'
31+
with:
32+
fetch-depth: 0
33+
- name: setup-go
34+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
35+
with:
36+
go-version: 1.23.x
37+
- uses: anchore/sbom-action/download-syft@df80a981bc6edbc4e220a492d3cbe9f5547a6e75 # v0.17.9
38+
- name: setup qemu
39+
id: qemu
40+
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3
41+
- name: setup docker buildx
42+
id: buildx
43+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
44+
- name: Login to GitHub Container Registry
45+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
- name: install cosign
51+
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3
52+
- name: install quill
53+
env:
54+
QUILL_VERSION: 0.4.1
55+
run: |
56+
curl -Lo /tmp/quill_${QUILL_VERSION}_linux_amd64.tar.gz https://github.com/anchore/quill/releases/download/v${QUILL_VERSION}/quill_${QUILL_VERSION}_linux_amd64.tar.gz
57+
tar -xvf /tmp/quill_${QUILL_VERSION}_linux_amd64.tar.gz -C /tmp
58+
mv /tmp/quill /usr/local/bin/quill
59+
chmod +x /usr/local/bin/quill
60+
- name: set goreleaser default args
61+
if: startsWith(github.ref, 'refs/tags/') == true
62+
run: |
63+
echo "GORELEASER_ARGS=" >> $GITHUB_ENV
64+
- name: set goreleaser args for branch
65+
if: startsWith(github.ref, 'refs/tags/') == false
66+
run: |
67+
echo "GORELEASER_ARGS=--snapshot" >> $GITHUB_ENV
68+
- name: set goreleaser args renovate
69+
if: startsWith(github.ref, 'refs/heads/renovate') == true
70+
run: |
71+
echo "GORELEASER_ARGS=--snapshot --skip publish --skip sign" >> $GITHUB_ENV
72+
- name: run goreleaser
73+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6
74+
with:
75+
distribution: goreleaser
76+
version: latest
77+
args: release --clean ${{ env.GORELEASER_ARGS }}
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
- name: push docker images (for branches)
81+
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
82+
run: |
83+
docker images --format "{{.Repository}}:{{.Tag}}" | grep "${{ github.repository }}" | xargs -L1 docker push
84+
- name: upload artifacts
85+
if: github.event.pull_request.base.ref == 'main'
86+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
87+
with:
88+
name: binaries
89+
path: releases/*.tar.gz

.github/workflows/semantic-lint.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: semantic-lint
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
14+
jobs:
15+
lint:
16+
name: semantic-lint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/semantic.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: semantic
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- next
7+
8+
permissions:
9+
contents: read # for checkout
10+
11+
jobs:
12+
release:
13+
name: release
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write # to be able to publish a GitHub release
17+
issues: write # to be able to comment on released issues
18+
pull-requests: write # to be able to comment on released pull requests
19+
id-token: write # to enable use of OIDC for npm provenance
20+
steps:
21+
- name: checkout
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
23+
with:
24+
fetch-depth: 0
25+
- name: setup node.js
26+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
27+
with:
28+
node-version: "lts/*"
29+
- name: release
30+
uses: cycjimmy/semantic-release-action@v4
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASER_GITHUB_TOKEN }}

.github/workflows/tests.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: tests
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
jobs:
7+
test:
8+
name: test
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
12+
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
13+
with:
14+
go-version: 1.23.x
15+
- name: download go mods
16+
run: |
17+
go mod download
18+
- name: run go tests
19+
run: |
20+
go test -timeout 60s -run ./...

0 commit comments

Comments
 (0)