mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 16:24:03 +03:00
FILE / ScuroNeko/mtg
.mise.toml
Исходный файл и его история в репозитории.
51 lines
1.2 KiB
TOML
51 lines
1.2 KiB
TOML
[tools]
|
|
go = "latest"
|
|
|
|
[tasks.build]
|
|
description = "Build binary"
|
|
sources = ["**/*.go", "go.mod", "go.sum"]
|
|
outputs = ["mtg"]
|
|
run = "go build"
|
|
|
|
[tasks.static]
|
|
description = "Build static binary"
|
|
sources = ["**/*.go", "go.mod", "go.sum"]
|
|
outputs = ["mtg"]
|
|
run = """
|
|
#!/bin/bash
|
|
|
|
version="$(git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)"
|
|
go build \
|
|
-trimpath \
|
|
-mod=readonly \
|
|
-ldflags="-extldflags '-static' -s -w -X 'main.version=$version'" \
|
|
-a \
|
|
-tags netgo
|
|
"""
|
|
|
|
[tasks.release]
|
|
description = "Create release tarballs"
|
|
tools.goreleaser = "latest"
|
|
sources = ["**/*.go", "go.mod", "go.sum", ".goreleaser.yml"]
|
|
run = [
|
|
"goreleaser --snapshot --clean",
|
|
"find dist -depth 1 -type d | xargs -r rm -r",
|
|
"rm ./dist/config.yaml"
|
|
]
|
|
|
|
[tasks.image]
|
|
description = "Build docker image"
|
|
sources = ["**/*.go", "go.mod", "go.sum", "Dockerfile"]
|
|
run = "docker buildx build --pull -t mtg ."
|
|
|
|
[tasks.docs]
|
|
description = "Run doc server"
|
|
tools."go:golang.org/x/pkgsite/cmd/pkgsite" = "latest"
|
|
run = "pkgsite -http 0.0.0.0:10000"
|
|
|
|
[tasks.fmt]
|
|
description = "Reformat source code"
|
|
tools.gofumpt = "latest"
|
|
sources = ["**/*.go"]
|
|
run = "gofumpt -w --extra ."
|