1

ci: simplify workflow
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Mya 2023-12-30 20:33:35 -06:00
parent 2fdc68654f
commit 689e96d4c1
Signed by: mya
GPG Key ID: 4DFBA0F91AC3544A
6 changed files with 37 additions and 24 deletions

2
.gitignore vendored
View File

@ -8,11 +8,11 @@
!buf.lock
!buf.yaml
!.woodpecker/*
!legal/*
!scripts/**/*
!swagger/*
!.woodpecker.yml
!LICENSE
!Makefile
!README.md

34
.woodpecker.yml Normal file
View File

@ -0,0 +1,34 @@
steps:
license:
image: golang:1.20
group: init
environment:
GO111MODULE: on
GOBIN: /usr/local/bin
commands:
- go install github.com/google/addlicense@latest
- addlicense -check -f ./legal/header.txt -skip yaml -skip yml -skip xml .
lint:
image: bufbuild/buf:1.28.1
group: init
commands:
- buf lint
generate:
image: bufbuild/buf:1.28.1
commands:
- buf generate .
swagger:
image: golang:1.20
environment:
GO111MODULE: on
GOBIN: /usr/local/bin
commands:
- cd scripts && go install ./merge-swagger && cd ..
- |
merge-swagger \
-output swagger.json \
"./*/*/*.swagger.json" \
"./swagger/metadata.json"

View File

@ -1,12 +0,0 @@
steps:
generate:
image: golang:1.20
environment:
GO111MODULE: on
GOBIN: /usr/local/bin
commands:
- go install github.com/bufbuild/buf/cmd/buf@latest
- make generate
- git status -s
depends_on: [ lint ]

View File

@ -1,10 +0,0 @@
steps:
lint:
image: golang:1.20
environment:
GO111MODULE: on
GOBIN: /usr/local/bin
commands:
- go install github.com/google/addlicense@latest
- go install github.com/bufbuild/buf/cmd/buf@latest
- make lint

View File

@ -29,5 +29,5 @@ generate:
buf generate .
cd scripts && go run ./merge-swagger \
-output ../swagger.json \
../**/*.swagger.json \
../*/*/*.swagger.json \
../swagger/metadata.json

View File

@ -16,6 +16,7 @@ import (
func newCLI(name, usage string) *CLI {
cli := &CLI{}
cli.FlagSet = flag.NewFlagSet(name, flag.ExitOnError)
cli.FlagSet.SetOutput(os.Stderr)
cli.FlagSet.Usage = func() {
cli.Printf("Usage:\n")