Skip to content

Commit 2f73a1f

Browse files
authored
build: upgrade buf and goreleaser (#495)
* build: upgrade buf and goreleaser * build: update workflows * lint: fix lint issues * build: change action version
1 parent 2fa5445 commit 2f73a1f

28 files changed

+80
-174
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-38
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

-20
This file was deleted.

.github/SECURITY.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Raystack takes the security of our software products and services seriously.
2+
3+
If you believe you have found a security vulnerability in this project, you can report it to us directly using [private vulnerability reporting][].
4+
5+
- Include a description of your investigation of the this project's codebase and why you believe an exploit is possible.
6+
- POCs and links to code are greatly encouraged.
7+
- Such reports are not eligible for a bounty reward.
8+
9+
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
10+
11+
Thanks for helping make GitHub safe for everyone.
12+
13+
[private vulnerability reporting]: https://github.com/raystack/meteor/security/advisories

.github/workflows/build.yml

+2-16
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ jobs:
1616
fetch-depth: 0
1717
- run: git fetch --force --tags
1818
- name: Set up Go
19-
uses: actions/setup-go@v3
19+
uses: actions/setup-go@v5
2020
with:
21-
go-version: "stable"
22-
cache: true
21+
go-version-file: "go.mod"
2322
- name: Get release tag
2423
id: get_version
2524
uses: battila7/get-version-action@v2
@@ -29,16 +28,3 @@ jobs:
2928
distribution: goreleaser
3029
version: ~v2
3130
args: --snapshot --clean
32-
- name: Login to GitHub Packages Docker Registry
33-
uses: docker/login-action@v1
34-
with:
35-
registry: docker.pkg.github.com
36-
username: ${{ github.actor }}
37-
password: ${{ secrets.GITHUB_TOKEN }}
38-
- name: Login to DockerHub
39-
uses: docker/login-action@v1
40-
with:
41-
username: ${{ secrets.DOCKERHUB_USERNAME }}
42-
password: ${{ secrets.DOCKERHUB_TOKEN }}
43-
- name: Push Images
44-
run: docker push docker.io/raystack/meteor:latest

.github/workflows/build_dev.yml

-23
This file was deleted.

.github/workflows/docs.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
name: docs
2-
1+
name: Docs
32
on:
43
push:
54
branches:
@@ -11,7 +10,7 @@ jobs:
1110
runs-on: ubuntu-latest
1211
steps:
1312
- name: Checkout code
14-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1514
- uses: actions/setup-node@v2
1615
- name: Installation
1716
uses: bahmutov/npm-install@v1

.github/workflows/lint.yml

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
name: lint
2-
1+
name: Lint
32
on:
43
push:
5-
branches:
6-
- main
4+
paths:
5+
- "**.go"
6+
- go.mod
7+
- go.sum
78
pull_request:
9+
paths:
10+
- "**.go"
11+
- go.mod
12+
- go.sum
813

914
jobs:
1015
lint:
1116
runs-on: ubuntu-latest
1217
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
1321
- name: Setup Go
14-
uses: actions/setup-go@v4
22+
uses: actions/setup-go@v5
1523
with:
16-
go-version: "1.20"
17-
- name: Checkout
18-
uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0
21-
- name: Run linter
22-
uses: golangci/golangci-lint-action@v3
24+
go-version-file: "go.mod"
25+
26+
- name: Run checks
27+
uses: golangci/golangci-lint-action@v6
2328
with:
24-
version: v1.53
29+
version: v1.60
2530
args: --timeout=5m

.github/workflows/release.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
name: release
2-
1+
name: Release
32
on:
43
push:
54
tags:
@@ -18,8 +17,7 @@ jobs:
1817
- name: Set up Go
1918
uses: actions/setup-go@v5
2019
with:
21-
go-version: "stable"
22-
cache: true
20+
go-version-file: "go.mod"
2321
- name: Login to DockerHub
2422
uses: docker/login-action@v1
2523
with:

.github/workflows/test.yml

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Test
2-
32
on:
43
push:
54
pull_request:
@@ -10,12 +9,11 @@ jobs:
109
runs-on: ubuntu-latest
1110
steps:
1211
- name: Checkout code
13-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1413
- name: Set up Go
15-
uses: actions/setup-go@v3
14+
uses: actions/setup-go@v5
1615
with:
17-
go-version: '1.20'
18-
cache: true
16+
go-version-file: "go.mod"
1917
- name: Install dependencies
2018
run: sudo apt-get install build-essential
2119
- name: Run Test
@@ -32,12 +30,12 @@ jobs:
3230
plugins: ${{ steps.set-matrix.outputs.plugins }}
3331
steps:
3432
- name: Checkout code
35-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3634
- id: set-matrix
3735
run: |
3836
echo "plugins=$(find plugins -mindepth 2 -maxdepth 2 -type d | sed 's/plugins\///' | awk 'BEGIN{printf "["} {printf "%s\"%s\"",sep,$0; sep=","} END{print ",\".\"]"}')" >> $GITHUB_OUTPUT
3937
40-
plugins-test:
38+
plugins:
4139
needs: pretest
4240
runs-on: ubuntu-latest
4341
if: |
@@ -49,12 +47,11 @@ jobs:
4947
plugins: ${{ fromJson(needs.pretest.outputs.plugins) }}
5048
steps:
5149
- name: Checkout code
52-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
5351
- name: Set up Go
54-
uses: actions/setup-go@v3
52+
uses: actions/setup-go@v5
5553
with:
56-
go-version: '1.20'
57-
cache: true
54+
go-version-file: "go.mod"
5855
- name: Install dependencies
5956
run: sudo apt-get install build-essential
6057
- name: Run Test
@@ -67,15 +64,14 @@ jobs:
6764

6865
coverage:
6966
runs-on: ubuntu-latest
70-
needs: [test, plugins-test]
67+
needs: [test, plugins]
7168
steps:
7269
- name: Checkout code
73-
uses: actions/checkout@v3
70+
uses: actions/checkout@v4
7471
- name: Set up Go
75-
uses: actions/setup-go@v3
72+
uses: actions/setup-go@v5
7673
with:
77-
go-version: '1.20'
78-
cache: true
74+
go-version-file: "go.mod"
7975
- name: Download coverage
8076
uses: actions/download-artifact@v3
8177
with:
@@ -89,4 +85,4 @@ jobs:
8985
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9086
run: |
9187
go install github.com/mattn/[email protected]
92-
goveralls -coverprofile=$(ls -1 coverage*.out | paste -sd "," -) -service=github
88+
goveralls -coverprofile=$(ls -1 coverage*.out | paste -sd "," -) -service=github

.goreleaser.yml

+6-16
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,26 @@ before:
1111
- make clean
1212

1313
changelog:
14+
use: github
1415
sort: asc
1516
filters:
16-
exclude:
17-
- "^docs:"
18-
- "^test:"
19-
- "^build:"
17+
exclude: ["^docs:", "^test:", "^build:", "^refactor:", "^style:", "^chore:"]
2018

2119
builds:
2220
- main: ./main.go
23-
id: "linux"
2421
binary: meteor
2522
flags: [-a]
2623
ldflags:
2724
- -X github.com/raystack/meteor/cmd.Version={{.Tag}}
2825
- -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}}
2926
- -X github.com/raystack/meteor/cmd.BuildDate={{.Date}}
3027
goos: ["linux", "windows", "darwin"]
31-
goarch: [amd64, arm64] # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library
28+
goarch: [amd64, arm64] # Skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library
3229
env:
3330
- CGO_ENABLED=0
34-
ignore: # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library
35-
- goos: linux
36-
goarch: 386
31+
ignore:
3732
- goos: linux
3833
goarch: arm
39-
- goos: windows
40-
goarch: 386
4134
- goos: windows
4235
goarch: arm
4336

@@ -51,7 +44,7 @@ checksum:
5144
name_template: "checksums.txt"
5245

5346
snapshot:
54-
name_template: "{{ .Tag }}-next"
47+
version_template: "{{ .Tag }}-next"
5548

5649
dockers:
5750
- goos: linux
@@ -69,10 +62,7 @@ nfpms:
6962
description: "Metadata collection tool."
7063
homepage: https://github.com/raystack/meteor
7164
license: Apache 2.0
72-
formats:
73-
- deb
74-
- rpm
75-
- apk
65+
formats: [deb, rpm, apk]
7666

7767
scoops:
7868
- homepage: "https://github.com/raystack/meteor"

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NAME="github.com/raystack/meteor"
22
VERSION=$(shell git describe --always --tags 2>/dev/null)
33
COVERFILE="/tmp/app.coverprofile"
4-
PROTON_COMMIT := "42b77358cbb68335607e99794f729e4a558974a5"
4+
PROTON_COMMIT := "ae895e033f71df187c62d7cf9431a2e259ddd423"
55
.PHONY: all build clean test
66

77
all: build
@@ -28,20 +28,20 @@ test-plugins:
2828
@echo " > Testing plugins with tag 'plugins'"
2929
go test $(if $(filter .,$(PLUGIN)),./plugins,$(if $(PLUGIN),./plugins/$(PLUGIN)/...,./plugins/...)) -tags=plugins -coverprofile=coverage-plugins$(subst .,root,$(subst /,-,$(if $(PLUGIN),-$(PLUGIN),))).out -parallel=1
3030

31-
test-coverage: # test test-plugins
31+
test-coverage:
3232
cp coverage.out coverage-all.out
3333
tail -n +2 coverage-plugins.out >> coverage-all.out
3434
go tool cover -html=coverage-all.out
3535

36-
generate-proto: ## regenerate protos
36+
generate-proto:
3737
@echo " > cloning protobuf from raystack/proton"
3838
@echo " > generating protobuf"
3939
@buf generate --template buf.gen.yaml https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --path raystack/assets/v1beta2
4040
@echo " > protobuf compilation finished"
4141

42-
lint: ## Lint with golangci-lint
42+
lint:
4343
golangci-lint run
4444

45-
install: ## install required dependencies
45+
install:
4646
@echo "> installing dependencies"
4747
go install github.com/vektra/mockery/[email protected]

buf.gen.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
version: v1
1+
version: v2
22
plugins:
3-
- name: go
3+
- remote: buf.build/protocolbuffers/go:v1.31.0
44
out: models
55
opt: paths=source_relative

cmd/info.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func InfoProccCmd() *cobra.Command {
161161

162162
func inform(typ string, summary string, err error) error {
163163
if err != nil {
164-
fmt.Println(term.Redf("ERROR:"), term.Redf(err.Error()))
164+
fmt.Println(term.Redf("ERROR: %s", err.Error()))
165165
fmt.Println(term.Bluef("\nUse 'meteor list %s' for the list of supported %s.", typ, typ))
166166
return nil
167167
}

0 commit comments

Comments
 (0)