Skip to content

Commit 4e291c1

Browse files
committed
feat(pages): add searchable build index
1 parent 4c3332e commit 4e291c1

13 files changed

Lines changed: 631 additions & 11 deletions

.github/workflows/android13.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ jobs:
244244
245245
export WORKFLOW_RUN_ID="${{ github.run_id }}"
246246
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
247+
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"
247248
248249
./scripts/patcher_a13.sh \
249250
"${{ github.event.inputs.api_level }}" \

.github/workflows/android14.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ jobs:
244244
245245
export WORKFLOW_RUN_ID="${{ github.run_id }}"
246246
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
247+
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"
247248
248249
./scripts/patcher_a14.sh \
249250
"${{ github.event.inputs.api_level }}" \

.github/workflows/android15.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ jobs:
258258
# Pass CI metadata for build manifest
259259
export WORKFLOW_RUN_ID="${{ github.run_id }}"
260260
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
261+
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"
261262
262263
./scripts/patcher_a15.sh \
263264
${{ github.event.inputs.api_level }} \

.github/workflows/android16.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ jobs:
253253
254254
export WORKFLOW_RUN_ID="${{ github.run_id }}"
255255
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
256+
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"
256257
257258
./scripts/patcher_a16.sh \
258259
"${{ github.event.inputs.api_level }}" \

.github/workflows/release-engine.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
- name: Checkout repository
1919
uses: actions/checkout@v4
2020

21+
- name: Render GitHub Pages index
22+
run: |
23+
python3 scripts/core/render_pages_index.py --output /tmp/index.html
24+
2125
- name: Validate version
2226
run: |
2327
FILE_VERSION=$(tr -d '[:space:]' < VERSION)
@@ -105,7 +109,9 @@ jobs:
105109
cd gh-pages
106110
git config user.name "github-actions[bot]"
107111
git config user.email "github-actions[bot]@users.noreply.github.com"
112+
cp /tmp/index.html index.html
108113
git add builds/latest.json
114+
git add index.html
109115
if git diff --cached --quiet; then
110116
echo "No latest.json changes to commit"
111117
else

.github/workflows/update-build-index.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
2828

29+
- name: Render GitHub Pages index
30+
run: |
31+
python3 scripts/core/render_pages_index.py --output /tmp/index.html
32+
2933
- name: Setup gh-pages branch
3034
run: |
3135
git config user.name "github-actions[bot]"
@@ -87,11 +91,13 @@ jobs:
8791
base_rom = os.environ.get("BASE_ROM", "unknown")
8892
device_file = os.environ.get("DEVICE_FILE", f"builds/{device}.json")
8993
run_id = "${{ github.event.workflow_run.id }}"
90-
repo = "${{ github.repository }}"
9194
9295
with open(manifest_path) as f:
9396
manifest = json.load(f)
9497
98+
manifest_release_url = manifest.get("release_url") or manifest.get("workflow_url")
99+
manifest_workflow_url = manifest.get("workflow_url", "")
100+
95101
# Load or create device index
96102
if os.path.exists(device_file):
97103
with open(device_file) as f:
@@ -100,7 +106,6 @@ jobs:
100106
device_data = {"device": device, "builds": {}}
101107
102108
# Upsert build entry
103-
release_url = f"https://github.com/{repo}/actions/runs/{run_id}"
104109
device_data["builds"][base_rom] = {
105110
"android_version": manifest.get("android_version", "unknown"),
106111
"patch_version": manifest.get("patch_engine_version", "unknown"),
@@ -109,7 +114,8 @@ jobs:
109114
"git_commit": manifest.get("git_commit", ""),
110115
"checksums": manifest.get("checksums", {}),
111116
"workflow_run_id": run_id,
112-
"release_url": release_url,
117+
"workflow_url": manifest_workflow_url,
118+
"release_url": manifest_release_url,
113119
}
114120
device_data["last_updated"] = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
115121
@@ -133,6 +139,9 @@ jobs:
133139
"android_version": manifest.get("android_version", "unknown"),
134140
"build_time": manifest.get("build_time", ""),
135141
"patch_version": manifest.get("patch_engine_version", "unknown"),
142+
"release_url": manifest_release_url,
143+
"workflow_url": manifest_workflow_url,
144+
"features": manifest.get("features", []),
136145
}
137146
138147
with open(index_path, "w") as f:
@@ -162,7 +171,8 @@ jobs:
162171
run: |
163172
git config user.name "github-actions[bot]"
164173
git config user.email "github-actions[bot]@users.noreply.github.com"
165-
git add builds/
174+
cp /tmp/index.html index.html
175+
git add index.html builds/
166176
if git diff --cached --quiet; then
167177
echo "No changes to commit"
168178
else

scripts/core/manifest.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Build manifest generation for traceability and reproducibility.
44

55
# Requires: PATCH_ENGINE_VERSION (from version.sh)
6-
# Usage: generate_manifest <device> <base_rom> <android_version> <api_level> <features_csv> [workflow_run_id] [workflow_url]
6+
# Usage: generate_manifest <device> <base_rom> <android_version> <api_level> <features_csv> [workflow_run_id] [workflow_url] [release_url]
77
# Output: writes build-manifest.json to $WORK_DIR (or cwd)
88

99
generate_manifest() {
@@ -14,6 +14,7 @@ generate_manifest() {
1414
local features_csv="$5"
1515
local workflow_run_id="${6:-local}"
1616
local workflow_url="${7:-}"
17+
local release_url="${8:-}"
1718

1819
local manifest_file="${WORK_DIR:-.}/build-manifest.json"
1920
local git_commit git_branch build_time
@@ -74,7 +75,8 @@ except:
7475
"apktool": "${apktool_version}"
7576
},
7677
"workflow_run_id": "${workflow_run_id}",
77-
"workflow_url": "${workflow_url}"
78+
"workflow_url": "${workflow_url}",
79+
"release_url": "${release_url}"
7880
}
7981
MANIFEST_EOF
8082

scripts/core/module.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ create_module() {
2121
local features_csv="${6:-}"
2222
local workflow_run_id="${7:-local}"
2323
local workflow_url="${8:-}"
24+
local release_url="${9:-}"
2425

2526
log "Creating module using FrameworkPatcherModule for $device_name (v$version_name)"
2627

@@ -146,7 +147,7 @@ create_module() {
146147
fi
147148

148149
# Generate build manifest
149-
generate_manifest "$device_name" "$version_name" "${android_version:-unknown}" "${api_level:-unknown}" "$features_csv" "$workflow_run_id" "$workflow_url"
150+
generate_manifest "$device_name" "$version_name" "${android_version:-unknown}" "${api_level:-unknown}" "$features_csv" "$workflow_run_id" "$workflow_url" "$release_url"
150151

151152
# Embed manifest in module ZIP
152153
local manifest_src="${WORK_DIR:-.}/build-manifest.json"

0 commit comments

Comments
 (0)