Eric Bower
·
2026-01-02
Makefile
1DOCKER_TAG?=$(shell git log --format="%H" -n 1)
2DOCKER_PLATFORM?=linux/amd64,linux/arm64
3DOCKER_CMD?=docker
4DOCKER_BUILDX_BUILD?=$(DOCKER_CMD) buildx build --push --platform $(DOCKER_PLATFORM) -t
5
6fmt:
7 go fmt ./...
8.PHONY: fmt
9
10lint:
11 golangci-lint run
12.PHONY: lint
13
14test:
15 go test ./...
16.PHONY: test
17
18check: fmt lint test
19.PHONY: check
20
21snapshot:
22 UPDATE_SNAPS=true go test ./...
23.PHONY: snapshot
24
25build:
26 go build -o ./build/git-pr ./cmd/git-pr
27.PHONY: build
28
29bp-setup:
30ifeq ($(DOCKER_CMD),docker)
31 $(DOCKER_CMD) buildx ls | grep pico || $(DOCKER_CMD) buildx create --name pico
32 $(DOCKER_CMD) buildx use pico
33else
34 # podman
35endif
36.PHONY: bp-setup
37
38bp: bp-setup
39 $(DOCKER_BUILDX_BUILD) ghcr.io/picosh/pico/git-pr:$(DOCKER_TAG) --target release .
40ifeq ($(DOCKER_CMD),docker)
41 # docker
42else
43 podman manifest push ghcr.io/picosh/pico/git-pr:$(DOCKER_TAG)
44endif
45.PHONY: bp
46
47smol:
48 curl https://pico.sh/smol.css -o ./static/smol.css
49.PHONY: smol