From 8e05ee28ed1bbc85de345cdc18dc01e9d869e957 Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Tue, 25 May 2021 12:59:37 +0200 Subject: [PATCH] Base pages on gir-docs --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++-------- public/_redirects | 1 + 2 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 public/_redirects diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19998ae80..4b1119cdb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,8 +28,13 @@ include: variables: FDO_UPSTREAM_REPO: gstreamer/gstreamer-rs - RUST_DOCS_FLAGS: "--extern-html-root-url=glib=https://gtk-rs.org/gtk-rs/git/docs/ --extern-html-root-url=gio=https://gtk-rs.org/gtk-rs/git/docs/ --extern-html-root-url=muldiv=https://docs.rs/muldiv/1.0.0/muldiv/ --enable-index-page -Z unstable-options" - + RUST_DOCS_FLAGS: "--extern-html-root-url=muldiv=https://docs.rs/muldiv/1.0.0/muldiv/ -Z unstable-options" + # format is = + # the name is used in the URL + # latest release must be at the top + # (only relevant on master branch) + RELEASES: + 0.16=0.16 stages: - "container-base" @@ -447,27 +452,42 @@ docs: extends: .img-nightly stage: 'extras' script: + - curl --proto '=https' --tlsv1.2 -sSf -o gir-docs.py + https://gitlab.gnome.org/World/Rust/gir-docs/-/raw/main/gir-docs.py + - chmod +x gir-docs.py - PATH=~/.cargo/bin/:$PATH ./generator.py --embed-docs --no-fmt - | - crate_names=$(for manifest in gstreamer*/Cargo.toml; do echo -n " -p ${manifest%%/Cargo.toml}"; done) - crate_names="$crate_names -p gstreamer-gl-egl -p gstreamer-gl-wayland -p gstreamer-gl-x11" - RUSTDOCFLAGS="$RUST_DOCS_FLAGS" cargo +nightly doc $crate_names --color=always --features=dox --no-deps - - mv target/doc public/ + RUSTDOCFLAGS="$RUST_DOCS_FLAGS" + eval $(./gir-docs.py pre-docs) + cargo +nightly doc --workspace --exclude examples --exclude tutorials --color=always --features=dox --no-deps + - mv target/doc docs artifacts: paths: - - 'public' + - 'docs' # https://docs.gitlab.com/ee/user/project/pages/#how-it-works # GitLab automatically deploys the `public/` folder from an # artifact generated by the job named `pages`. This step # re-uses the docs from the build-test `docs` step above. pages: + extends: .img-nightly stage: 'deploy' - when: 'manual' dependencies: - docs script: + - curl --proto '=https' --tlsv1.2 -sSf -o gir-docs.py + https://gitlab.gnome.org/World/Rust/gir-docs/-/raw/main/gir-docs.py + - chmod +x gir-docs.py + - ./gir-docs.py html-index + # development docs + - mkdir public/git + - mv docs public/git/docs + # stable docs + - ./gir-docs.py docs-from-artifacts - ls public/ artifacts: paths: - 'public' + rules: + - if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main" + when: 'manual' diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 000000000..5c90c73e2 --- /dev/null +++ b/public/_redirects @@ -0,0 +1 @@ +/gstreamer-rs/gstreamer/ /gstreamer-rs/stable/latest/docs/gstreamer 301