mirror of
https://github.com/gogs/gogs.git
synced 2026-05-28 21:30:36 +00:00
102 lines
2.0 KiB
YAML
102 lines
2.0 KiB
YAML
$schema: "https://moonrepo.dev/schemas/project.json"
|
|
|
|
language: "go"
|
|
stack: "backend"
|
|
id: "gogs"
|
|
|
|
fileGroups:
|
|
sources:
|
|
- "cmd/**/*.go"
|
|
- "internal/**/*.go"
|
|
- "public/**/*.go"
|
|
- "templates/**/*.go"
|
|
- "conf/**/*.go"
|
|
tests:
|
|
- "**/*_test.go"
|
|
configs:
|
|
- "go.mod"
|
|
- "go.sum"
|
|
- ".golangci.yml"
|
|
assets:
|
|
- "conf/**/*"
|
|
- "public/**/*"
|
|
- "templates/**/*"
|
|
|
|
tasks:
|
|
install:
|
|
command: "go mod tidy"
|
|
inputs:
|
|
- "@group(configs)"
|
|
|
|
format:
|
|
command: "golangci-lint fmt"
|
|
inputs:
|
|
- "@group(sources)"
|
|
- "@group(configs)"
|
|
deps:
|
|
- "install"
|
|
|
|
lint:
|
|
command: "golangci-lint run"
|
|
inputs:
|
|
- "@group(sources)"
|
|
- "@group(configs)"
|
|
deps:
|
|
- "install"
|
|
- "format"
|
|
|
|
test:
|
|
command: "go test -cover -race ./..."
|
|
inputs:
|
|
- "@group(sources)"
|
|
- "@group(tests)"
|
|
- "@group(configs)"
|
|
deps:
|
|
- "install"
|
|
|
|
build:
|
|
script: |
|
|
go build -trimpath \
|
|
-ldflags "-X 'gogs.io/gogs/internal/conf.BuildTime=$(date -u '+%Y-%m-%d %I:%M:%S %Z')' -X 'gogs.io/gogs/internal/conf.BuildCommit=$(git rev-parse HEAD)'" \
|
|
-o .bin/gogs ./cmd/gogs
|
|
inputs:
|
|
- "@group(sources)"
|
|
- "@group(configs)"
|
|
- "@group(assets)"
|
|
outputs:
|
|
- ".bin/gogs"
|
|
deps:
|
|
- "install"
|
|
|
|
build-prod:
|
|
script: |
|
|
go build -trimpath -tags prod \
|
|
-ldflags "-X 'gogs.io/gogs/internal/conf.BuildTime=$(date -u '+%Y-%m-%d %I:%M:%S %Z')' -X 'gogs.io/gogs/internal/conf.BuildCommit=$(git rev-parse HEAD)'" \
|
|
-o .bin/gogs ./cmd/gogs
|
|
inputs:
|
|
- "@group(sources)"
|
|
- "@group(configs)"
|
|
- "@group(assets)"
|
|
outputs:
|
|
- ".bin/gogs"
|
|
deps:
|
|
- "install"
|
|
- "web:build"
|
|
|
|
dev:
|
|
command: ".bin/gogs web"
|
|
preset: "server"
|
|
env:
|
|
TTY_FORCE: "1"
|
|
deps:
|
|
- "build"
|
|
- "web:dev"
|
|
|
|
prod:
|
|
command: ".bin/gogs web"
|
|
preset: "server"
|
|
env:
|
|
TTY_FORCE: "1"
|
|
deps:
|
|
- "build-prod"
|