CI docs: use gir-rustdoc for generating extern crates url
@@ -27,23 +27,12 @@ jobs:
run: cargo build --release
- run: cargo install rustdoc-stripper
- run: git clone https://gitlab.gnome.org/World/Rust/gir-rustdoc/ # checkout action doesn't support random urls
- - run: python3 ./gir-rustdoc/gir-rustdoc.py --default-branch 'master' --branch 'master' pre-docs
- run: python3 ./generator.py --embed-docs --yes ./
- - run: python3 ./gir-rustdoc/gir-rustdoc.py --project-title 'GTK 4 Rust bindings' html-index --early-section 'Book' '<ul><li><a href="stable/book">Stable</a></li><li><a href="git/book">Development</a></li></ul>'
- run: echo "DEST=$(if [ "$GITHUB_EVENT_NAME" == "release" ]; then echo 'stable/${{ github.event.release.tag_name }}'; else echo 'git'; fi)" >> ${GITHUB_ENV}
- - uses: actions-rs/cargo@v1
+ - run: echo "RUSTDOCFLAGS=$(eval python3 ./gir-rustdoc/gir-rustdoc.py --pages-url 'https://gtk-rs.org/gtk4-rs/' --default-branch 'master' --branch 'master' pre-docs | xargs)" >> ${GITHUB_ENV}
env:
- RUSTDOCFLAGS: |
- -Z unstable-options --enable-index-page
- --html-before-content ./_rustdoc-html-before-content.html
- --extern-html-root-url=glib=https://gtk-rs.org/gtk-rs-core/${{ env.DEST }}/docs/
- --extern-html-root-url=gio=https://gtk-rs.org/gtk-rs-core/${{ env.DEST }}/docs/
- --extern-html-root-url=cairo=https://gtk-rs.org/gtk-rs-core/${{ env.DEST }}/docs/
- --extern-html-root-url=gdk_pixbuf=https://gtk-rs.org/gtk-rs-core/${{ env.DEST }}/docs/
- --extern-html-root-url=graphene=https://gtk-rs.org/gtk-rs-core/${{ env.DEST }}/docs/
- --extern-html-root-url=pango=https://gtk-rs.org/gtk-rs-core/${{ env.DEST }}/docs/
- --extern-html-root-url=wayland_client=https://smithay.github.io/wayland-rs/
- --extern-html-root-url=x11=https://docs.rs/x11/latest/
+ RUSTDOCFLAGS: --extern-html-root-url=wayland_client=https://smithay.github.io/wayland-rs/ --extern-html-root-url=x11=https://docs.rs/x11/latest/
+ - uses: actions-rs/cargo@v1
with:
command: doc
args: -p gdk4 -p gdk4-sys -p gdk4-wayland -p gdk4-wayland-sys -p gdk4-x11 -p gdk4-x11-sys -p gsk4 -p gsk4-sys -p gtk4 -p gtk4-sys -p gtk4-macros --features "dox" --no-deps
@@ -67,6 +56,7 @@ jobs:
keep_files: false
destination_dir: ${{ env.DEST }}/docs
+ - run: python3 ./gir-rustdoc/gir-rustdoc.py --project-title 'GTK 4 Rust bindings' html-index --early-section 'Book' '<ul><li><a href="git/book">Development</a></li></ul>'
- name: deploy index page
uses: peaceiris/actions-gh-pages@v3
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
