ci: simplify workflow
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
2fdc68654f
commit
689e96d4c1
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,11 +8,11 @@
|
||||
!buf.lock
|
||||
!buf.yaml
|
||||
|
||||
!.woodpecker/*
|
||||
!legal/*
|
||||
!scripts/**/*
|
||||
!swagger/*
|
||||
|
||||
!.woodpecker.yml
|
||||
!LICENSE
|
||||
!Makefile
|
||||
!README.md
|
||||
|
34
.woodpecker.yml
Normal file
34
.woodpecker.yml
Normal 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"
|
@ -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 ]
|
@ -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
|
2
Makefile
2
Makefile
@ -29,5 +29,5 @@ generate:
|
||||
buf generate .
|
||||
cd scripts && go run ./merge-swagger \
|
||||
-output ../swagger.json \
|
||||
../**/*.swagger.json \
|
||||
../*/*/*.swagger.json \
|
||||
../swagger/metadata.json
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user