chore: more spring cleaning and refactoring
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -47,13 +47,13 @@ jobs:
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Run make release
|
||||
run: make release
|
||||
- name: Run make build
|
||||
run: make build
|
||||
|
||||
- name: Check for uncommitted changes
|
||||
run: |
|
||||
if [ -n "$(git diff --name-only)" ]; then
|
||||
echo "Generated files are out of date. Run 'make release' and commit the results."
|
||||
echo "Generated files are out of date. Run 'make build' and commit the results."
|
||||
echo ""
|
||||
echo "Changed files:"
|
||||
git diff --name-only
|
||||
|
||||
@@ -16,7 +16,7 @@ cd Obtainium-Emulation-Pack
|
||||
# Make your changes to src/applications.json (or use make add-app)
|
||||
make validate # check for structural errors
|
||||
make test # verify configs resolve to real APKs
|
||||
make release # normalize, regenerate README, build release JSONs
|
||||
make build # normalize, regenerate README, build release JSONs
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
@@ -64,7 +64,7 @@ This will:
|
||||
|
||||
> **Tip:** To find the package ID, open the app in Obtainium - the package ID is displayed directly below the source URL (e.g., `com.example.android`).
|
||||
|
||||
After running, execute `make release` to regenerate all files.
|
||||
After running, execute `make build` to regenerate all files.
|
||||
|
||||
### Option B: Manual Add (For complex configs or non-GitHub sources)
|
||||
|
||||
@@ -119,7 +119,7 @@ Add a `meta` object to customize how the app appears:
|
||||
```bash
|
||||
make validate # check for structural errors
|
||||
make test # verify your app config resolves to a real APK
|
||||
make release # normalize, regenerate README, build release JSONs
|
||||
make build # normalize, regenerate README, build release JSONs
|
||||
```
|
||||
|
||||
## CI
|
||||
@@ -128,13 +128,13 @@ Pull requests and pushes to `main` are checked by GitHub Actions:
|
||||
|
||||
1. **Validate** - runs `make validate` (structural checks, regex syntax, source types)
|
||||
2. **Live Test** - runs `make test` (verifies all app configs resolve to real APKs)
|
||||
3. **Check Generated Files** - runs `make release` and fails if generated files are out of date
|
||||
3. **Check Generated Files** - runs `make build` and fails if generated files are out of date
|
||||
|
||||
All three must pass before merging.
|
||||
|
||||
## Pre-Commit Checklist
|
||||
|
||||
Before committing, run `make test` and `make release`, then verify:
|
||||
Before committing, run `make test` and `make build`, then verify:
|
||||
|
||||
- [ ] `make test` passes (all app configs resolve to downloadable APKs)
|
||||
- [ ] `obtainium-emulation-pack-latest.json` has been updated
|
||||
@@ -154,7 +154,7 @@ Before committing, run `make test` and `make release`, then verify:
|
||||
| `make test` | Live-test all app configs resolve to downloadable APKs |
|
||||
| `make test-app APP=name` | Live-test a single app by name (partial match) |
|
||||
| `make test-verbose` | Live-test all apps with APK URL details |
|
||||
| `make release` | Full pipeline: validate, normalize, readme, both JSONs |
|
||||
| `make build` | Full pipeline: validate, normalize, readme, both JSONs |
|
||||
| `make normalize` | Normalize key order and backfill defaults |
|
||||
| `make table` | Generate the README table only |
|
||||
| `make readme` | Generate README.md from pages |
|
||||
|
||||
9
Makefile
9
Makefile
@@ -1,9 +1,10 @@
|
||||
.PHONY: help all readme validate add-app normalize publish publish-dry-run publish-from-file test test-app test-verbose
|
||||
.PHONY: help all readme validate add-app normalize build publish publish-dry-run publish-from-file test test-app test-verbose
|
||||
default: help
|
||||
|
||||
help: # Show help for each of the makefile recipes.
|
||||
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; \
|
||||
do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
|
||||
@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
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Apps
|
||||
@@ -31,7 +32,7 @@ test-verbose: # Live-test with APK URL details shown
|
||||
# Build
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
release: validate normalize readme minify minify-dual-screen # Run all Make targets related to cutting a release.
|
||||
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
|
||||
|
||||
@@ -168,5 +168,5 @@ cd Obtainium-Emulation-Pack
|
||||
|
||||
# Add or edit apps in src/applications.json (or use make add-app)
|
||||
make test # verify configs resolve to real APKs
|
||||
make release # validate, regenerate README, and build release JSONs
|
||||
make build # validate, regenerate README, and build release JSONs
|
||||
```
|
||||
|
||||
@@ -10,5 +10,5 @@ cd Obtainium-Emulation-Pack
|
||||
|
||||
# Add or edit apps in src/applications.json (or use make add-app)
|
||||
make test # verify configs resolve to real APKs
|
||||
make release # validate, regenerate README, and build release JSONs
|
||||
make build # validate, regenerate README, and build release JSONs
|
||||
```
|
||||
|
||||
@@ -357,7 +357,7 @@ def main() -> int:
|
||||
print()
|
||||
|
||||
print("Next steps:")
|
||||
print(" 1. Run 'make release' to regenerate all files")
|
||||
print(" 1. Run 'make build' to regenerate all files")
|
||||
print(" 2. Review the diff before committing")
|
||||
|
||||
return 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Create a GitHub release with tagged JSON artifacts.
|
||||
|
||||
Expects `make release` to have already been run. This script only handles
|
||||
Expects `make build` to have already been run. This script only handles
|
||||
the publish side: tagging, pushing, and creating the GitHub release.
|
||||
|
||||
Workflow:
|
||||
@@ -12,7 +12,7 @@ Workflow:
|
||||
6. Create git tag, push, and create GitHub release
|
||||
|
||||
Usage:
|
||||
make release # build artifacts first
|
||||
make build # build artifacts first
|
||||
make publish # then publish
|
||||
|
||||
Requires: gh (GitHub CLI), git, python3
|
||||
@@ -463,7 +463,7 @@ def main() -> None:
|
||||
for f in (STANDARD_JSON, DUAL_SCREEN_JSON):
|
||||
if not f.exists():
|
||||
print(f"Error: Expected artifact not found: {f}")
|
||||
print("Did you run `make release` first?")
|
||||
print("Did you run `make build` first?")
|
||||
sys.exit(1)
|
||||
|
||||
# Show summary before proceeding
|
||||
@@ -486,7 +486,7 @@ def main() -> None:
|
||||
print("Aborted.")
|
||||
sys.exit(0)
|
||||
|
||||
# Commit any uncommitted changes (e.g. from `make release`)
|
||||
# Commit any uncommitted changes (e.g. from `make build`)
|
||||
if not check_working_tree_clean():
|
||||
print()
|
||||
print("Working tree has changes. Committing...")
|
||||
|
||||
Reference in New Issue
Block a user