This repository was archived by the owner on Sep 23, 2024. It is now read-only.
forked from sqlc-dev/sqlc-gen-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 1.26 KB
/
Makefile
File metadata and controls
42 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
VERSION := $$(make -s show-version)
CURRENT_REVISION := $(shell git rev-parse --short HEAD)
BUILD_LDFLAGS := "-s -w -X main.revision=$(CURRENT_REVISION)"
GOBIN ?= $(shell go env GOPATH)/bin
.PHONY: show-version
show-version: $(GOBIN)/gobump
@gobump show -r cmd/sqlc-gen-python-orm
$(GOBIN)/gobump:
@go install github.com/x-motemen/gobump/cmd/gobump@latest
.PHONY: compile
compile:
sqlc compile
.PHONY: generate
generate: sqlc.yaml
sqlc generate
.PHONY: release
release: dist/sqlc-gen-python-orm.wasm dist/sqlc-gen-python-orm.wasm.sha256
gh release create "v${VERSION}" dist/sqlc-gen-python-orm.wasm dist/sqlc-gen-python-orm.wasm.sha256
.PHONY: release
release-overwrite: dist/sqlc-gen-python-orm.wasm dist/sqlc-gen-python-orm.wasm.sha256
gh release delete -y --cleanup-tag "v${VERSION}"
gh release create "v${VERSION}" dist/sqlc-gen-python-orm.wasm dist/sqlc-gen-python-orm.wasm.sha256
.PHONY: clean
clean:
rm -rf ./_examples/gen
sqlc.yaml: dist/sqlc-gen-python-orm.wasm.sha256 _sqlc.yaml
cat _sqlc.yaml | WASM_SHA256=$$(cat $<) envsubst > $@
dist/sqlc-gen-python-orm.wasm.sha256: dist/sqlc-gen-python-orm.wasm
openssl sha256 $< | awk '{print $$2}' > $@
dist/sqlc-gen-python-orm.wasm: internal/*
GOOS=wasip1 GOARCH=wasm go build -o $@ ./cmd/sqlc-gen-python-orm/main.go