jx/Makefile
Matthew Rich cb37477e7b
All checks were successful
Lint / golangci-lint (push) Successful in 9m46s
Declarative Tests / test (push) Successful in 21s
Declarative Tests / build (push) Successful in 1m32s
fix typo in spec filename
2024-05-26 19:49:36 -07:00

20 lines
705 B
Makefile

LDFLAGS?=--ldflags '-extldflags "-static"' --ldflags="-X 'main.commit=$(shell git rev-parse HEAD)' -X 'main.version=$(shell git describe --tags)' -X 'main.date=$(shell date '+%Y-%m-%d %T.%s%z')'"
export CGO_ENABLED=1
VERSION?=$(shell git describe --tags | sed -e 's/^v//' -e 's/-/_/g')
.PHONY=jx-cli
build: jx-cli
jx-cli:
go build -o jx $(LDFLAGS) ./cmd/cli/main.go
test: jx-cli
go test -coverprofile=artifacts/coverage.profile ./...
go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html
rpm:
echo Building $(VERSION)
dnf install -y nodejs git dnf-plugins-core rpm-build rpmdevtools
spectool -g -R build/jx.spec
rpmbuild -ba --define='version $(VERSION)' build/jx.spec