add justfile as primary task runner, slim Makefile to CI-only. add styled argparse help formatter, parallel test execution (-j8 default), argparse for test-apps.py. release.py accepts --dryrun alias
This commit is contained in:
78
Makefile
78
Makefile
@@ -1,71 +1,39 @@
|
||||
.PHONY: help readme validate add-app normalize build publish publish-dry-run publish-from-file test test-app test-apks test-verbose
|
||||
default: help
|
||||
# These targets exist for CI (GitHub Actions) only.
|
||||
# For local development, use the justfile: run `just` to see all commands.
|
||||
|
||||
help: # Show help for each of the makefile recipes.
|
||||
@width=$$(grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | cut -f1 -d':' | awk '{print length}' | sort -rn | head -1); \
|
||||
grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; \
|
||||
do printf "\033[1;32m%-$${width}s\033[00m %s\n" "$$(echo $$l | cut -f 1 -d':')" "$$(echo $$l | cut -f 2- -d'#')"; done
|
||||
.PHONY: help validate test build normalize table readme minify minify-dual-screen
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Apps
|
||||
# ---------------------------------------------------------------------------
|
||||
help: ## Show available targets
|
||||
@echo "CI-only build targets. For local development, run 'just' to see all commands."
|
||||
@echo ""
|
||||
@grep -E '^[a-z].*:.*##' Makefile | sed 's/:.*## /\t/' | while IFS=$$'\t' read -r target desc; do \
|
||||
printf "\033[1;32m%-20s\033[0m %s\n" "$$target" "$$desc"; \
|
||||
done
|
||||
|
||||
add-app: # Interactive CLI to add a new app
|
||||
@python scripts/add-app.py
|
||||
|
||||
validate: # Validate applications.json for errors (structure, regex syntax, source types)
|
||||
validate: ## Validate applications.json for errors
|
||||
@python scripts/validate-json.py src/applications.json
|
||||
|
||||
normalize: # Normalize key order and add missing defaults in applications.json
|
||||
test: ## Live-test all app configs resolve to downloadable APKs
|
||||
@python scripts/test-apps.py
|
||||
|
||||
build: validate normalize readme minify minify-dual-screen ## Build all artifacts
|
||||
|
||||
normalize: ## Normalize key order and add missing defaults
|
||||
@python scripts/normalize-json.py src/applications.json
|
||||
|
||||
test: # Live-test that all app configs can resolve to downloadable APKs
|
||||
@python scripts/test-apps.py src/applications.json
|
||||
|
||||
test-app: # Live-test a single app by name (e.g. make test-app APP=Dolphin)
|
||||
@python scripts/test-apps.py src/applications.json --verbose --apks $(APP)
|
||||
|
||||
test-apks: # Live-test all apps and show numbered APK list for index selection
|
||||
@python scripts/test-apps.py src/applications.json --apks
|
||||
|
||||
test-verbose: # Live-test with APK URL details shown
|
||||
@python scripts/test-apps.py src/applications.json --verbose
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Build
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
build: validate normalize readme minify minify-dual-screen # Build all artifacts: validate, normalize, readme, and both release JSONs.
|
||||
|
||||
minify: # Generate standard release JSON
|
||||
@python scripts/minify-json.py src/applications.json obtainium-emulation-pack-latest.json --variant standard
|
||||
|
||||
minify-dual-screen: # Generate dual screen release JSON
|
||||
@python scripts/minify-json.py src/applications.json obtainium-emulation-pack-dual-screen-latest.json --variant dual-screen
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Docs
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
table: # Generate a table of obtainium links for the README.
|
||||
table: ## Generate markdown table for the README
|
||||
@python scripts/generate-table.py src/applications.json ./pages/table.md
|
||||
|
||||
readme: table # Generate the readme file. Why? Because editing that table every change is tedious.
|
||||
readme: table ## Generate the README from page sections
|
||||
@python scripts/generate-readme.py \
|
||||
./pages/header.md \
|
||||
./pages/table.md \
|
||||
./pages/faq.md \
|
||||
./pages/footer.md
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Publish
|
||||
# ---------------------------------------------------------------------------
|
||||
minify: ## Generate standard release JSON
|
||||
@python scripts/minify-json.py src/applications.json obtainium-emulation-pack-latest.json --variant standard
|
||||
|
||||
publish: # Tag, push, and create a GitHub release (opens $EDITOR for notes)
|
||||
@python scripts/release.py
|
||||
|
||||
publish-dry-run: # Preview release notes as a markdown file without publishing
|
||||
@python scripts/release.py --dry-run
|
||||
|
||||
publish-from-file: # Publish using a previously edited release notes file (e.g. from publish-dry)
|
||||
@python scripts/release.py --notes-file $(FILE)
|
||||
minify-dual-screen: ## Generate dual-screen release JSON
|
||||
@python scripts/minify-json.py src/applications.json obtainium-emulation-pack-dual-screen-latest.json --variant dual-screen
|
||||
|
||||
Reference in New Issue
Block a user