Skip to content
This repository was archived by the owner on Mar 13, 2021. It is now read-only.

Commit 090c5e9

Browse files
authored
Make white labeling even easier (#240)
Creating a white labeled build of the riff cli is now possible: NAME=ostinato make build Produces a binary at `./bin/ostinato` The path within the project for built binaries has moved to `./bin/riff` and for packaged artifacts to `./dist/riff-linux-amd64.tgz`. The bin and dist directories are ignored from git.
1 parent e0d8e2a commit 090c5e9

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

.github/workflows/stage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ make release
1515

1616
bucket=gs://projectriff/riff-cli/releases
1717

18-
gsutil cp -a public-read -n riff-*{.tgz,.zip} ${bucket}/builds/v${slug}/
18+
gsutil cp -a public-read -n dist/riff-*{.tgz,.zip} ${bucket}/builds/v${slug}/

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# built artifacts
2-
/riff
3-
/riff.zip
4-
/riff-*.tgz
5-
/riff-*.zip
2+
/bin
3+
/dist
64

75
# coverage artifacts
86
/coverage.txt

Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
OUTPUT = ./riff
1+
NAME ?= riff
2+
OUTPUT = ./bin/$(NAME)
23
GO_SOURCES = $(shell find . -type f -name '*.go')
34
GOBIN ?= $(shell go env GOPATH)/bin
45
VERSION ?= $(shell cat VERSION)
56
GITSHA = $(shell git rev-parse HEAD)
67
GITDIRTY = $(shell git diff --quiet HEAD || echo "dirty")
7-
LDFLAGS_VERSION = -X github.com/projectriff/cli/pkg/cli.cli_name=riff \
8+
LDFLAGS_VERSION = -X github.com/projectriff/cli/pkg/cli.cli_name=$(NAME) \
89
-X github.com/projectriff/cli/pkg/cli.cli_version=$(VERSION) \
910
-X github.com/projectriff/cli/pkg/cli.cli_gitsha=$(GITSHA) \
1011
-X github.com/projectriff/cli/pkg/cli.cli_gitdirty=$(GITDIRTY) \
@@ -15,10 +16,8 @@ all: build test verify-goimports docs ## Build, test, verify source formatting a
1516

1617
.PHONY: clean
1718
clean: ## Delete build output
18-
rm -f $(OUTPUT)
19-
rm -f riff-darwin-amd64.tgz
20-
rm -f riff-linux-amd64.tgz
21-
rm -f riff-windows-amd64.zip
19+
rm -f bin/
20+
rm -f dist/
2221

2322
.PHONY: build
2423
build: $(OUTPUT) ## Build riff
@@ -52,9 +51,9 @@ $(OUTPUT): $(GO_SOURCES) VERSION
5251

5352
.PHONY: release
5453
release: $(GO_SOURCES) VERSION ## Cross-compile riff for various operating systems
55-
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS_VERSION)" -o $(OUTPUT) ./cmd/riff && tar -czf riff-darwin-amd64.tgz $(OUTPUT) && rm -f $(OUTPUT)
56-
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS_VERSION)" -o $(OUTPUT) ./cmd/riff && tar -czf riff-linux-amd64.tgz $(OUTPUT) && rm -f $(OUTPUT)
57-
GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS_VERSION)" -o $(OUTPUT).exe ./cmd/riff && zip -mq riff-windows-amd64.zip $(OUTPUT).exe && rm -f $(OUTPUT).exe
54+
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS_VERSION)" -o $(OUTPUT) ./cmd/riff && tar -czf dist/$(NAME)-darwin-amd64.tgz $(OUTPUT) && rm -f $(OUTPUT)
55+
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS_VERSION)" -o $(OUTPUT) ./cmd/riff && tar -czf dist/$(NAME)-linux-amd64.tgz $(OUTPUT) && rm -f $(OUTPUT)
56+
GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS_VERSION)" -o $(OUTPUT).exe ./cmd/riff && zip -mq dist/$(NAME)-windows-amd64.zip $(OUTPUT).exe && rm -f $(OUTPUT).exe
5857

5958
docs: $(OUTPUT) clean-docs ## Generate documentation
6059
$(OUTPUT) docs

0 commit comments

Comments
 (0)