-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* goreleaser: init * goreleaser: add support for windows and darwin targets * build: use goreleaser for builds in make and Dockerfile * build: revert to using go build for local builds * ci: add release workflow * build: optimise builds for production * ci: combine release into a single step
- Loading branch information
Showing
8 changed files
with
133 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ raccoon | |
.temp | ||
node_modules | ||
__debug.* | ||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj | ||
|
||
version: 2 | ||
|
||
project_name: raccoon | ||
|
||
release: | ||
prerelease: auto | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
changelog: | ||
use: github | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
- "^build:" | ||
|
||
|
||
builds: | ||
- id: "raccoon" | ||
main: ./ | ||
flags: [-trimpath] | ||
ldflags: | ||
- -s -w | ||
- -X github.com/raystack/raccoon/config.Version={{.Tag}} | ||
- -X github.com/raystack/raccoon/config.BuildCommit={{.FullCommit}} | ||
- -X github.com/raystack/raccoon/config.BuildDate={{.Date}} | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ignore: | ||
# confluent-kafka-go doesn't support arm64 on windows | ||
# https://github.com/confluentinc/confluent-kafka-go/blob/master/kafka/librdkafka_vendor/README.md | ||
- goos: windows | ||
goarch: arm64 | ||
env: | ||
- CGO_ENABLED=1 | ||
- >- | ||
{{- if eq .Os "darwin" }} | ||
{{- if eq .Arch "amd64" }}CC=x86_64-apple-darwin21.1-clang{{- end }} | ||
{{- if eq .Arch "arm64" }}CC=aarch64-apple-darwin21.1-clang{{- end }} | ||
{{- end }} | ||
{{- if eq .Os "linux" }} | ||
{{- if eq .Arch "amd64" }}CC=x86_64-linux-gnu-gcc{{- end}} | ||
{{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }} | ||
{{- end}} | ||
{{- if eq .Os "windows" }} | ||
{{- if eq .Arch "amd64" }}CC=x86_64-w64-mingw32-gcc{{- end }} | ||
{{- end}} | ||
archives: | ||
- id: "archives" | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
dockers: | ||
- id: dockerhub | ||
image_templates: | ||
- "docker.io/raystack/{{.ProjectName}}:latest" | ||
- "docker.io/raystack/{{.ProjectName}}:{{ .Version }}" | ||
- "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}-amd64" | ||
|
||
nfpms: | ||
- maintainer: Raystack | ||
description: Scalable event ingestion tool. | ||
homepage: https://github.com/raystack/raccoon | ||
license: Apache 2.0 | ||
formats: | ||
- deb | ||
- rpm | ||
- apk | ||
|
||
scoops: | ||
- homepage: "https://github.com/raystack/raccoon" | ||
description: "Scalable event ingestion tool" | ||
license: Apache 2.0 | ||
repository: | ||
owner: raystack | ||
name: scoop-bucket | ||
|
||
brews: | ||
- name: raccoon | ||
homepage: "https://github.com/raystack/raccoon" | ||
description: "Scalable event ingestion tool" | ||
repository: | ||
owner: raystack | ||
name: homebrew-tap | ||
license: "Apache 2.0" | ||
directory: Formula | ||
dependencies: | ||
- name: git | ||
install: |- | ||
bin.install "raccoon" | ||
commit_author: | ||
name: Ravi Suhag | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
NAME="github.com/raystack/raccoon" | ||
COMMIT := $(shell git rev-parse --short HEAD) | ||
TAG := "$(shell git rev-list --tags --max-count=1)" | ||
VERSION := "$(shell git describe --tags ${TAG})-next" | ||
VERSION := "$(shell git describe --tags ${TAG})" | ||
BUILD_DIR=dist | ||
PROTON_COMMIT := "ccbf219312db35a934361ebad895cb40145ca235" | ||
BUILD_FLAGS=-trimpath | ||
LD_FLAGS=-ldflags "-s -w -X ${NAME}/config.Version=${VERSION}" | ||
|
||
.PHONY: all build clean test tidy vet proto setup format generate | ||
|
||
|
@@ -32,18 +34,21 @@ setup: ## Install required dependencies | |
@echo "> Installing dependencies..." | ||
go mod tidy | ||
go install github.com/bufbuild/buf/cmd/[email protected] | ||
go install github.com/goreleaser/goreleaser/v2@latest | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
||
config: ## Generate the sample config file | ||
@echo "Initializing sample server config..." | ||
@cp .env.sample .env | ||
|
||
build: ## Build the raccoon binary | ||
@echo "Building racccoon version ${VERSION}..." | ||
go build | ||
@echo "Building raccoon version ${VERSION}..." | ||
go build ${BUILD_FLAGS} ${LD_FLAGS} ${NAME} | ||
@echo "Build complete" | ||
|
||
install: | ||
@echo "Installing Guardian to ${GOBIN}..." | ||
@echo "Installing Raccoon to ${GOBIN}..." | ||
go install ${BUILD_FLAGS} ${LD_FLAGS} ${NAME} | ||
@go install | ||
|
||
test: ## Run the tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package config | ||
|
||
var Version, BuildCommit, BuildDate string |
This file was deleted.
Oops, something went wrong.