feat: Automate releases with goreleaser (#404)

This commit is contained in:
Kyle Carberry
2022-03-07 19:50:37 -06:00
committed by GitHub
parent e1205a033f
commit 3eb6fb75d6
18 changed files with 126 additions and 115 deletions
+12 -12
View File
@@ -2,17 +2,11 @@ INSTALL_DIR=$(shell go env GOPATH)/bin
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
bin/coder:
mkdir -p bin
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o bin/coder-$(GOOS)-$(GOARCH) cmd/coder/main.go
.PHONY: bin/coder
bin:
goreleaser build --single-target --snapshot --rm-dist
.PHONY: bin
bin/coderd:
mkdir -p bin
go build -o bin/coderd cmd/coderd/main.go
.PHONY: bin/coderd
build: site/out bin/coder bin/coderd
build: site/out bin
.PHONY: build
# Runs migrations to output a dump of the database.
@@ -55,9 +49,9 @@ fmt: fmt/prettier fmt/sql
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
.PHONY: gen
install:
install: bin
@echo "--- Copying from bin to $(INSTALL_DIR)"
cp -r ./bin $(INSTALL_DIR)
cp -r ./dist/coder_$(GOOS)_$(GOARCH) $(INSTALL_DIR)
@echo "-- CLI available at $(shell ls $(INSTALL_DIR)/coder*)"
.PHONY: install
@@ -92,4 +86,10 @@ site/out:
./scripts/yarn_install.sh
cd site && yarn build
cd site && yarn export
# Restores GITKEEP files!
git checkout HEAD site/out
.PHONY: site/out
snapshot:
goreleaser release --snapshot --rm-dist
.PHONY: snapshot