Skip to content

Commit

Permalink
refactor!: complete rewrite (#36)
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Braun <rainbowstack@gmail.com>
  • Loading branch information
bluebrown authored Jan 25, 2024
1 parent f009b6d commit b178a55
Show file tree
Hide file tree
Showing 280 changed files with 8,923 additions and 6,413 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
COMPOSE_PROJECT_NAME=kobold
COMPOSE_FILE=build/compose.yaml
KOBOLD_CONFIG=testdata/kobold.toml
SKAFFOLD_FILENAME=e2e/skaffold.yaml
9 changes: 7 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/usr/bin/env bash
PATH_add bin
dotenv_if_exists

dotenv .env
dotenv_if_exists .local/.env

PATH_add .local/bin

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/.local/lib"
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
13 changes: 13 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "go",
"changelog-path": ".github/CHANGELOG.md",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false
}
}
}
3 changes: 3 additions & 0 deletions .github/release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.2.4"
}
33 changes: 0 additions & 33 deletions .github/release.sh

This file was deleted.

41 changes: 13 additions & 28 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
name: check

name: checks
on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review

- main
permissions:
contents: read
pull-requests: read
jobs:
validation:
checks:
name: checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with: {go-version: "1.20"}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Install dependencies
run: go mod download

- name: Run all checks
run: make -j check

- name: Build artifacts
run: make -j artifacts
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21.5'
- run: make -j checks
12 changes: 12 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: image
on:
workflow_dispatch: {}
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make dockerlogin dockerimage dockerpush
env:
DOCKER_BUILDKIT: "1"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
22 changes: 0 additions & 22 deletions .github/workflows/pages.yaml

This file was deleted.

65 changes: 25 additions & 40 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,31 @@
name: release

on:
workflow_dispatch:
inputs:
preRelease:
description: Create a pre release, if set
type: boolean
default: false

workflow_dispatch: {}
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set git config
run: |
git config --global user.email "noreply@bluebrown.github.io"
git config --global user.name "GitHub Actions"
- name: Login to the container registry
run: docker login --username bluebrown --password ${{secrets.DOCKERHUB_TOKEN}}

- name: Set up Go
uses: actions/setup-go@v4
with: {go-version: "1.21"}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Create a github release
run: make -j github-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRE_RELEASE: ${{ github.event.inputs.preRelease == 'true' && '1' || '0' }}

- name: Publish docs
run: make -j github-pages
if: github.events.inputs.preRelease != 'true'
- id: release
uses: google-github-actions/release-please-action@v4
with:
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
- if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v3
- if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-go@v4
with:
go-version: '1.21.5'
- if: ${{ steps.release.outputs.release_created }}
env:
RELEASE_TAG: ${{ steps.release.outputs.tag_name }}
DOCKER_BUILDKIT: "1"
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make -j release
12 changes: 5 additions & 7 deletions .github/workflows/triage.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: triage

on:
issues:
types:
- opened

- opened
jobs:
label_issue:
runs-on: ubuntu-latest
steps:
- run: gh issue edit $ISSUE_URL --add-label "triage"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
- run: gh issue edit $ISSUE_URL --add-label "triage"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
15 changes: 3 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/.dump/
/.out/
/.dist/

/bin/*

.env
!/manifests/base/etc/.env
!/manifests/example/etc/.env
!/e2e/kobold/etc/.env

dockerconfig.json
.artifacts/
.local/
.tmp/
39 changes: 39 additions & 0 deletions .golangci.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[linters]
disable-all = true
enable = [
"asasalint",
"asciicheck",
"bidichk",
"bodyclose",
"contextcheck",
"dupword",
"durationcheck",
"errcheck",
"errchkjson",
# "exhaustive",
"exportloopref",
# "forbidigo",
"gci",
"gocheckcompilerdirectives",
"gochecksumtype",
"godot",
# "godox",
"gofmt",
# "gomodguard",
"gosec",
"gosmopolitan",
"makezero",
"misspell",
"musttag",
"nilerr",
"noctx",
"perfsprint",
"prealloc",
"promlinter",
"revive",
"sloglint",
"tenv",
"thelper",
"tparallel",
# "typecheck",
]
7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

9 changes: 7 additions & 2 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
continue_on_error: true
doublestar: true
include:
- "**/*.yaml"
exclude:
- "**/testdata/**"
formatter:
type: basic
indent: 2
scan_folded_as_literal: true
retain_line_breaks: true
retain_line_breaks: false
indentless_arrays: true
35 changes: 25 additions & 10 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
Copyright (C) 2022 by Nico Braun <rainbowstack@gmail.com>
Copyright (c) 2023 Nico Braun. All rights reserved.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the project name nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit b178a55

Please sign in to comment.