Skip to content

Commit

Permalink
feat: add initial project setup with CLI commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nullswan committed Sep 12, 2024
0 parents commit 5178bff
Show file tree
Hide file tree
Showing 19 changed files with 1,398 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
pull_request:
push:

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Download Go module dependencies
run: go mod download

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
skip-cache: true
version: v1.59.1
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# https://goreleaser.com/ci/actions/
name: goreleaser

on:
push:
tags:
- "*"

permissions:
contents: write
packages: write
issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Download Go module dependencies
run: go mod download

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
linters:
disable-all: true
enable:
- bodyclose
- containedctx
- contextcheck
- durationcheck
- errcheck
- exhaustive
- gocheckcompilerdirectives
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofumpt
- gosec
- gosimple
- govet
- ineffassign
- mnd
- nilerr
- nilnil
- noctx
- paralleltest
- perfsprint
- prealloc
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- staticcheck
- thelper
- typecheck
- unconvert
- unparam
- unused
- unused
- usestdlibvars
- whitespace
- whitespace
- wrapcheck

linters-settings:
exhaustive:
check:
- switch
- map
default-signifies-exhaustive: true
ignore-enum-members: ".+UNSPECIFIED"

severity:
default-severity: error

run:
timeout: 5m
modules-download-mode: readonly
Empty file added LICENSE
Empty file.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: generate
generate:
@echo "Generating..."
@oapi-codegen -generate types,client -package api schema.yaml > api/api.gen.go

.PHONY: build
build: generate
Loading

0 comments on commit 5178bff

Please sign in to comment.