diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 1f78404..8fe5f5f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -22,6 +22,9 @@ builds: - -X github.com/boolean-maybe/tiki/config.Version={{.Version}} - -X github.com/boolean-maybe/tiki/config.GitCommit={{.FullCommit}} - -X github.com/boolean-maybe/tiki/config.BuildDate={{.Date}} + hooks: + post: + - cmd: sh -c '{{ if eq .Os "darwin" }}command -v codesign >/dev/null 2>&1 && codesign -s - {{ .Path }} || true{{ else }}true{{ end }}' archives: - id: tiki diff --git a/Makefile b/Makefile index bbf690f..353c202 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,15 @@ help: build: @echo "Building tiki $(VERSION)..." go build $(LDFLAGS) -o tiki . +ifeq ($(shell uname),Darwin) + codesign -s - tiki +endif -# Build and install to GOPATH/bin -install: - @echo "Installing tiki $(VERSION)..." - go install $(LDFLAGS) . +# Build, sign, and install to ~/.local/bin +install: build + @echo "Installing tiki to ~/.local/bin..." + @mkdir -p ~/.local/bin + cp tiki ~/.local/bin/tiki # Clean build artifacts clean: diff --git a/README.md b/README.md index c2f913f..301f791 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,9 @@ and simply copy the `tiki` executable to any location and make it available via ### Build from source ```bash -GOBIN=$HOME/.local/bin go install github.com/boolean-maybe/tiki@latest +git clone https://github.com/boolean-maybe/tiki.git +cd tiki +make build install ``` ### Verify installation