Skip to content

Commit b5f6ca8

Browse files
authored
Feat/delete component (#47)
1 parent 8f77105 commit b5f6ca8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1357
-5139
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: ["v*.*.*"]
5+
6+
jobs:
7+
release:
8+
name: Release on GitHub
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
cache-dependency-path: "**/*.sum"
19+
- name: Run GoReleaser
20+
uses: goreleaser/goreleaser-action@v5
21+
with:
22+
version: latest
23+
args: release --clean
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.TOKEN }}

.goreleaser.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
builds:
2-
- main: ./cmds/lava/main.go
2+
- main: ./cmds/protoc-gen-lava/main.go
3+
id: protoc-gen-lava
4+
binary: protoc-gen-lava
5+
goos:
6+
- linux
7+
- darwin
8+
- windows
9+
- main: ./main.go
310
id: lava
411
binary: lava
512
env:
@@ -8,8 +15,6 @@ builds:
815
- linux
916
- darwin
1017
- windows
11-
goarch:
12-
- amd64
1318
ldflags:
1419
- -X 'github.com/pubgo/lava/version.BuildTime={{ .Date }}'
1520
- -X 'github.com/pubgo/lava/version.CommitID={{ .Commit }}'
@@ -18,4 +23,4 @@ archives:
1823
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
1924
format: binary
2025
replacements:
21-
amd64: x86_64
26+
amd64: x86_64

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ protobuf:
4545
lint:
4646
golangci-lint --version
4747
golangci-lint run --timeout 3m --verbose ./...
48+
49+
install-protoc:
50+
go install -v ./cmds/protoc-gen-lava

buildtasks/bench.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package buildtasks
2+
3+
import "fmt"
4+
5+
type BenchMode int
6+
7+
const (
8+
BenchModeWazero BenchMode = iota
9+
BenchModeCGO
10+
BenchModeDefault
11+
)
12+
13+
func BenchArgs(pkg string, count int, mode BenchMode, libName string) []string {
14+
args := []string{"test", "-bench=.", "-run=^$", "-v", "-timeout=60m"}
15+
if count > 0 {
16+
args = append(args, fmt.Sprintf("-count=%d", count))
17+
}
18+
switch mode {
19+
case BenchModeCGO:
20+
args = append(args, fmt.Sprintf("-tags=%s_cgo", libName))
21+
case BenchModeDefault:
22+
args = append(args, fmt.Sprintf("-tags=%s_bench_default", libName))
23+
}
24+
args = append(args, pkg)
25+
26+
return args
27+
}

buildtasks/lint.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package buildtasks
2+
3+
import (
4+
"github.com/goyek/goyek/v2"
5+
"github.com/goyek/x/cmd"
6+
)
7+
8+
var GoLint = goyek.Define(goyek.Task{
9+
Name: "go-lint",
10+
Usage: "golangci-lint run --fix",
11+
Action: func(a *goyek.A) {
12+
if !cmd.Exec(a, "go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest") {
13+
return
14+
}
15+
cmd.Exec(a, "golangci-lint run --fix")
16+
},
17+
})

buildtasks/util.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package buildtasks
2+
3+
import (
4+
"os/exec"
5+
6+
"github.com/goyek/goyek/v2"
7+
"github.com/goyek/x/cmd"
8+
)
9+
10+
// check if docker is installed and running
11+
func checkDocker(a *goyek.A) bool {
12+
if !hasBinary("docker") {
13+
return true
14+
}
15+
16+
return cmd.Exec(a, "docker ps")
17+
}
18+
19+
// check if a binary exists
20+
func hasBinary(binaryName string) bool {
21+
_, err := exec.LookPath(binaryName)
22+
return err == nil
23+
}

cmds/protoc-gen-cloud-job/internal/gen.go

Lines changed: 0 additions & 135 deletions
This file was deleted.

cmds/protoc-gen-cloud-job/main.go

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)