Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/android13.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ jobs:

export WORKFLOW_RUN_ID="${{ github.run_id }}"
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"

./scripts/patcher_a13.sh \
"${{ github.event.inputs.api_level }}" \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/android14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ jobs:

export WORKFLOW_RUN_ID="${{ github.run_id }}"
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"

./scripts/patcher_a14.sh \
"${{ github.event.inputs.api_level }}" \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/android15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ jobs:
# Pass CI metadata for build manifest
export WORKFLOW_RUN_ID="${{ github.run_id }}"
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"

./scripts/patcher_a15.sh \
${{ github.event.inputs.api_level }} \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/android16.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ jobs:

export WORKFLOW_RUN_ID="${{ github.run_id }}"
export WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
export WORKFLOW_RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/build-tmp-${{ github.run_id }}"

./scripts/patcher_a16.sh \
"${{ github.event.inputs.api_level }}" \
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Render GitHub Pages index
run: |
python3 scripts/core/render_pages_index.py --output /tmp/index.html

- name: Validate version
run: |
FILE_VERSION=$(tr -d '[:space:]' < VERSION)
Expand Down Expand Up @@ -105,7 +109,9 @@ jobs:
cd gh-pages
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
cp /tmp/index.html index.html
git add builds/latest.json
git add index.html
if git diff --cached --quiet; then
echo "No latest.json changes to commit"
else
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/update-build-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Render GitHub Pages index
run: |
python3 scripts/core/render_pages_index.py --output /tmp/index.html

- name: Setup gh-pages branch
run: |
git config user.name "github-actions[bot]"
Expand Down Expand Up @@ -87,11 +91,13 @@ jobs:
base_rom = os.environ.get("BASE_ROM", "unknown")
device_file = os.environ.get("DEVICE_FILE", f"builds/{device}.json")
run_id = "${{ github.event.workflow_run.id }}"
repo = "${{ github.repository }}"

with open(manifest_path) as f:
manifest = json.load(f)

manifest_release_url = manifest.get("release_url") or manifest.get("workflow_url")
manifest_workflow_url = manifest.get("workflow_url", "")

# Load or create device index
if os.path.exists(device_file):
with open(device_file) as f:
Expand All @@ -100,7 +106,6 @@ jobs:
device_data = {"device": device, "builds": {}}

# Upsert build entry
release_url = f"https://github.com/{repo}/actions/runs/{run_id}"
device_data["builds"][base_rom] = {
"android_version": manifest.get("android_version", "unknown"),
"patch_version": manifest.get("patch_engine_version", "unknown"),
Expand All @@ -109,7 +114,8 @@ jobs:
"git_commit": manifest.get("git_commit", ""),
"checksums": manifest.get("checksums", {}),
"workflow_run_id": run_id,
"release_url": release_url,
"workflow_url": manifest_workflow_url,
"release_url": manifest_release_url,
}
device_data["last_updated"] = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")

Expand All @@ -133,6 +139,9 @@ jobs:
"android_version": manifest.get("android_version", "unknown"),
"build_time": manifest.get("build_time", ""),
"patch_version": manifest.get("patch_engine_version", "unknown"),
"release_url": manifest_release_url,
"workflow_url": manifest_workflow_url,
"features": manifest.get("features", []),
}

with open(index_path, "w") as f:
Expand Down Expand Up @@ -162,7 +171,8 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add builds/
cp /tmp/index.html index.html
git add index.html builds/
if git diff --cached --quiet; then
echo "No changes to commit"
else
Expand Down
6 changes: 4 additions & 2 deletions scripts/core/manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Build manifest generation for traceability and reproducibility.

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

generate_manifest() {
Expand All @@ -14,6 +14,7 @@ generate_manifest() {
local features_csv="$5"
local workflow_run_id="${6:-local}"
local workflow_url="${7:-}"
local release_url="${8:-}"

local manifest_file="${WORK_DIR:-.}/build-manifest.json"
local git_commit git_branch build_time
Expand Down Expand Up @@ -74,7 +75,8 @@ except:
"apktool": "${apktool_version}"
},
"workflow_run_id": "${workflow_run_id}",
"workflow_url": "${workflow_url}"
"workflow_url": "${workflow_url}",
"release_url": "${release_url}"
}
MANIFEST_EOF

Expand Down
3 changes: 2 additions & 1 deletion scripts/core/module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ create_module() {
local features_csv="${6:-}"
local workflow_run_id="${7:-local}"
local workflow_url="${8:-}"
local release_url="${9:-}"

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

Expand Down Expand Up @@ -146,7 +147,7 @@ create_module() {
fi

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

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