mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Automate releases with goreleaser (#404)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user