Skip to content

Commit

Permalink
Attempt to implement docs build for the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tronical committed Nov 14, 2024
1 parent b4b6c4d commit 6b9def2
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,15 @@ jobs:
cp -r target/aarch64-linux-android/doc/i_slint_backend_android_activity/ target/doc/
cp -r target/aarch64-linux-android/doc/i_slint_backend_winit/ target/doc/
cp -r target/aarch64-linux-android/doc/i_slint_backend_testing/ target/doc/
- name: "Generate Screenshots for Example Snippets"
working-directory: docs
run: cargo run -p slint-docsnapper -- src/content --overwrite
- name: "Install Node dependencies for Slint and Node docs"
run: pnpm install --frozen-lockfile
- name: "Slint Language Documentation"
run: |
searchbox_html=docs/reference/_templates/searchbox.html
sed -i "s/\$TYPESENSE_SEARCH_API_KEY/${{ secrets.TYPESENSE_SEARCH_API_KEY }}/g" $searchbox_html
sed -i "s/\$TYPESENSE_SERVER_PROTOCOL/https/g" "$searchbox_html"
if [ "$RELEASE_INPUT" == "true" ]; then
version=$(sed -n 's/^version = "\(.*\)"/\1/p' docs/reference/conf.py)
sed -i "s/\$TYPESENSE_INDEX_NAME/$version/g" "$searchbox_html"
sed -i 's/sitemap_url_scheme = "master\/docs\/slint\/{link}"/sitemap_url_scheme = "{version}docs\/slint\/{link}"/' docs/reference/conf.py
sed -i "s/snapshots.slint.dev\/master/releases.slint.dev\/$version/" docs/editor/codemirror.js docs/editor/rollup.config.js
else
sed -i "s/\$TYPESENSE_INDEX_NAME/master/g" "$searchbox_html"
fi
sed -i "s/\$TYPESENSE_SERVER_PORT/443/g" "$searchbox_html"
sed -i "s/\$TYPESENSE_SERVER_URL/typesense.slint.dev/g" "$searchbox_html"
cargo xtask slintdocs --show-warnings
run: cargo xtask slintdocs
- name: "Node docs"

run: |
pnpm install --frozen-lockfile --ignore-scripts
pnpm run docs
run: pnpm run docs
working-directory: api/node

- name: Generate a token
Expand Down Expand Up @@ -143,12 +131,11 @@ jobs:
path: |
target/doc
target/cppdocs/html
target/slintdocs/html
docs/dist
api/node/docs
docs/site
- name: "Check for docs warnings in internal crates"
run: cargo doc --workspace --no-deps --all-features --exclude slint-node --exclude pyslint --exclude mcu-board-support --exclude printerdemo_mcu --exclude carousel --exclude test-* --exclude plotter --exclude uefi-demo --exclude ffmpeg --exclude gstreamer-player --exclude slint-cpp --exclude slint-python
- name: Clean cache # Don't cache docs to avoid them including removed classes being published
run: |
rm -rf target/doc target/cppdocs target/slintdocs api/node/docs
rm -rf target/doc target/cppdocs api/node/docs

0 comments on commit 6b9def2

Please sign in to comment.