dev: Improvements to build scripts (#232)

* dev: make sure that stuff is building properly

* chore: changelog

* remove npx
This commit is contained in:
Henri Vasserman 2025-04-12 05:00:48 +03:00 committed by GitHub
parent 51bd058f2d
commit 20f1d40b61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 496 additions and 22 deletions

View file

@ -1,27 +1,31 @@
NODE_MODULES = node_modules
VERSION := $(shell cat ./VERSION)
VERSION= $(shell cat ./VERSION)
GO?= go
NPM?= npm
.PHONY: build assets deps lint prebaked-build test
assets:
npm run assets
deps:
npm ci
go mod download
build: deps
npm run build
@echo "Anubis is now built to ./var/anubis"
all: build
lint:
go vet ./...
go tool staticcheck ./...
deps:
$(NPM) ci
$(GO) mod download
assets: PATH:=$(PWD)/node_modules/.bin:$(PATH)
assets: deps
$(GO) generate ./...
./web/build.sh
./xess/build.sh
build: assets
$(GO) build -o ./var/anubis ./cmd/anubis
@echo "Anubis is now built to ./var/anubis"
lint: assets
$(GO) vet ./...
$(GO) tool staticcheck ./...
prebaked-build:
go build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis
$(GO) build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis
test:
npm run test
test: assets
$(GO) test ./...