Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ jobs:
name: 📋 GolangCI
runs-on: ubuntu-latest
steps:
- name: ⬇️ Git clone the repository
uses: actions/checkout@v4
- name: ⬇️ Git clone the repository
uses: actions/checkout@v6

- name: 📦 Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: 📦 Install Mise
run: |
curl https://mise.run | sh
mise install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Action sometimes causes threading. Recommended to run in separate workflow action.
# See https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#how-to-use
- name: 🧪 GolangCI
uses: golangci/golangci-lint-action@v8
with:
version: v2.3
- name: 🧪 Lint
run: |
mise run lint
25 changes: 8 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

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

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 📦 Install Mise
run: |
curl https://mise.run | sh
mise install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
run: mise release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
vendor
bin
dist
54 changes: 54 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[tools]
go = "1.25"
"go:github.com/daixiang0/gci" = "latest"
"ubi:golangci/golangci-lint" = "2.5"
"ubi:goreleaser/goreleaser" = "2.12"

[env]
CGO_ENABLED=0
LGFLAGS="-extldflags '-static'"
IMAGE="skpr/grpc-go:latest"
PB_DIR="./pb"

[tasks.vendor]
description = "Vendor resets the main module's vendor directory to include all packages needed to build the application"
run = "go mod vendor"
depends = ["generate"]

[tasks.tidy]
description = "Tidy makes sure go.mod matches the source code in the module"
run = "go mod tidy"

[tasks.generate]
description = "Build the grpc protocol"
run = '''
rm -rf $PB_DIR
mkdir -p $PB_DIR
# Sadly can't get protoc on mac through mise.
docker build -t $IMAGE dockerfiles/grpc-go
docker run -it -w /data -v .:/data $IMAGE /bin/bash -c 'protoc --go_out=./pb --go_opt=paths=source_relative --go-grpc_out=./pb --go-grpc_opt=paths=source_relative *.proto'
'''

[tasks."build"]
description = "Build the application"
run = "go build -o bin/apiserver-mock -ldflags=${CLI_LDFLAGS} github.com/skpr/api/cmd/apiserver-mock"
depends = ["vendor"]

[tasks.mock]
description = "Run the application"
run = "bin/apiserver-mock"
depends = ["build"]

[tasks."lint"]
description = "Linting automatically checks code for errors and style issues"
run = "golangci-lint run"

[tasks.test]
description = "Checks to verify code correctness"
run = "go test -cover ./..."
depends = ["vendor"]

[tasks.release]
description = "Release the command line interface"
run = "goreleaser"
depends = ["build"]
22 changes: 0 additions & 22 deletions Makefile

This file was deleted.