Files
filament/docs_src/build/postsubmit.sh
Powei Feng a73957a590 web: refactor examples and tutorials (#9833)
* Refactor web examples and tutorials

- Consolidate web/docs and web/samples into web/examples
- Remove literal programming blocks from Markdown tutorials
- Replace tutorial_template.html with a fully embedded template in serve.py
- Move serve.py to web/examples/serve.py and update dependency rules
- Update filament-js wrapper to expose _malloc, _free and set GEN_MIPMAPPABLE usage
- Update sample materials and WebGL asset generation within web/examples/CMakeLists.txt
- Add python venv instructions and usage details to web/README.md
- Remove obsolete examples, Pipfile, and demo templates

* Transfer web tutorials and samples to docs_src

- Introduce copy_web_docs.py api to deploy and rewrite web sample outputs into the docs output tree
- Hook copy_web_docs into docs_src/build/run.py natively
- Configure duplicates.json to map WebGL outputs to embedded .md docs
- Strip html skeleton out of examples in run.py so they map into markdown cleanly
- Update update-docs workflow to pre-build the WebGL target
- Remove obsolete remote docs path from src_raw
- Add explanatory comments to copy_web_docs.py and run.py
- Add index page with thumbnails for Web Tutorials and samples
2026-03-25 23:52:48 +00:00

57 lines
1.8 KiB
Bash

#!/usr/bin/bash
# Copyright (C) 2025 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FILAMENT_BOT_TOKEN=$2
set -ex
function update_to_main() {
./build.sh -p webgl release
python3 docs_src/build/run.py
mkdir -p tmp
pushd .
cd tmp
git clone https://x-access-token:${FILAMENT_BOT_TOKEN}@github.com/google/filament.git
cd filament
rm -rf docs/*
cp -r ../../docs_src/src_mdbook/book/* docs
git add -A docs/*
git commit -a \
-m "[automated] Updating /docs due to commit ${COMMIT_HASH:0:7}" \
-m "" \
-m "Full commit hash is ${COMMIT_HASH}" \
-m "" \
-m "DOCS_ALLOW_DIRECT_EDITS"
git push origin main
popd
}
COMMIT_HASH=$1
HAS_EDITS=$((python3 docs_src/build/checks.py --do-or="source_edits,commit_docs_force" $COMMIT_HASH > /dev/null && echo "true") || echo "false")
DO_BYPASS=$((python3 docs_src/build/checks.py --do-and="commit_docs_bypass" $COMMIT_HASH && echo "true") || echo "false")
if [[ "${HAS_EDITS}" == "true" && "${DO_BYPASS}" == "false" ]]; then
# Run again to output the edited files:
python3 docs_src/build/checks.py --do-or="source_edits,commit_docs_force" $COMMIT_HASH
update_to_main
else
echo "has edits (to /docs_src): ${HAS_EDITS}"
echo "bypass: ${DO_BYPASS}"
fi
set +ex