Skip to content

Commit

Permalink
chore: update proto definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tochemey committed Jul 29, 2023
1 parent 442dd8f commit 96b89c0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ gen.env
gen/

dist/

dist/
30 changes: 21 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# .goreleaser.yaml
project_name: cos-cli

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -31,3 +38,8 @@ changelog:
exclude:
- '^docs:'
- '^test:'

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
34 changes: 4 additions & 30 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:alpine
VERSION 0.7

protogen:
FROM +golang-base
FROM tochemey/docker-go:1.20.4-0.8.0

protogen:
# copy the proto files to generate
COPY --dir protos/ ./
COPY buf.work.yaml buf.gen.yaml ./
Expand All @@ -13,30 +13,4 @@ protogen:
--path protos/chief-of-state-protos/chief_of_state/v1

# save artifact to
SAVE ARTIFACT gen gen AS LOCAL gen

golang-base:
WORKDIR /app

# install gcc dependencies into alpine for CGO
RUN apk add gcc musl-dev curl git openssh

# install docker tools
# https://docs.docker.com/engine/install/debian/
RUN apk add --update --no-cache docker

# install linter
# binary will be $(go env GOPATH)/bin/golangci-lint
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.0
RUN ls -la $(which golangci-lint)

# install the go generator plugins
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN export PATH="$PATH:$(go env GOPATH)/bin"

# install buf from source
RUN GO111MODULE=on GOBIN=/usr/local/bin go get \
github.com/bufbuild/buf/cmd/buf \
github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking \
github.com/bufbuild/buf/cmd/protoc-gen-buf-lint
SAVE ARTIFACT gen gen AS LOCAL gen

0 comments on commit 96b89c0

Please sign in to comment.