Add package-first build and distribution workflow
This commit is contained in:
parent
4a69c3d333
commit
993f51712b
13 changed files with 462 additions and 52 deletions
44
Makefile
44
Makefile
|
|
@ -1,10 +1,13 @@
|
|||
PYTHON ?= python3
|
||||
CONFIG := $(HOME)/.config/aman/config.json
|
||||
|
||||
.PHONY: run doctor self-check install sync test check
|
||||
DIST_DIR := $(CURDIR)/dist
|
||||
BUILD_DIR := $(CURDIR)/build
|
||||
|
||||
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||
RUN_CONFIG := $(if $(RUN_ARGS),$(abspath $(firstword $(RUN_ARGS))),$(CONFIG))
|
||||
|
||||
.PHONY: run doctor self-check sync test check build package package-deb package-arch release-check install-local install-service install clean-dist clean-build clean
|
||||
|
||||
ifneq ($(filter run,$(firstword $(MAKECMDGOALS))),)
|
||||
.PHONY: $(RUN_ARGS)
|
||||
$(RUN_ARGS):
|
||||
|
|
@ -24,14 +27,43 @@ sync:
|
|||
uv sync
|
||||
|
||||
test:
|
||||
python3 -m unittest discover -s tests -p 'test_*.py'
|
||||
$(PYTHON) -m unittest discover -s tests -p 'test_*.py'
|
||||
|
||||
check:
|
||||
python3 -m py_compile src/*.py
|
||||
$(PYTHON) -m py_compile src/*.py
|
||||
$(MAKE) test
|
||||
|
||||
install:
|
||||
uv pip install --user .
|
||||
build:
|
||||
$(PYTHON) -m build --no-isolation
|
||||
|
||||
package: package-deb package-arch
|
||||
|
||||
package-deb:
|
||||
./scripts/package_deb.sh
|
||||
|
||||
package-arch:
|
||||
./scripts/package_arch.sh
|
||||
|
||||
release-check:
|
||||
$(PYTHON) -m py_compile src/*.py tests/*.py
|
||||
$(MAKE) test
|
||||
$(MAKE) build
|
||||
|
||||
install-local:
|
||||
$(PYTHON) -m pip install --user ".[x11]"
|
||||
|
||||
install-service:
|
||||
mkdir -p $(HOME)/.config/systemd/user
|
||||
cp systemd/aman.service $(HOME)/.config/systemd/user/aman.service
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now aman
|
||||
|
||||
install: install-local install-service
|
||||
|
||||
clean-dist:
|
||||
rm -rf $(DIST_DIR)
|
||||
|
||||
clean-build:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
clean: clean-build
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue