Eric Bower
·
2025-08-22
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
18snapshot:
19 UPDATE_SNAPS=true go test ./...
20.PHONY: snapshot
21
22build:
23 go build -o ./build/git-pr ./cmd/git-pr
24.PHONY: build
25
26bp-setup:
27ifeq ($(DOCKER_CMD),docker)
28 $(DOCKER_CMD) buildx ls | grep pico || $(DOCKER_CMD) buildx create --name pico
29 $(DOCKER_CMD) buildx use pico
30else
31 # podman
32endif
33.PHONY: bp-setup
34
35bp: bp-setup
36 $(DOCKER_BUILDX_BUILD) ghcr.io/picosh/pico/git-pr:$(DOCKER_TAG) --target release .
37ifeq ($(DOCKER_CMD),docker)
38 # docker
39else
40 podman manifest push ghcr.io/picosh/pico/git-pr:$(DOCKER_TAG)
41endif
42.PHONY: bp
43
44smol:
45 curl https://pico.sh/smol.css -o ./static/smol.css
46.PHONY: smol