soup3 0.3.2

Soup crate for Rust
Documentation
variables:
  # format is <branch>=<name>
  # the name is used in the URL
  # latest release must be at the top
  # (only relevant on main branch)
  RELEASES: |
    v0.1=0.1.0-alpha-6
    v0.1=0.1.0-alpha-5
    v0.1=0.1.0-alpha-4
    v0.1=0.1.0-alpha-3
    v0.1=0.1.0-alpha-2
    v0.1=0.1.0-alpha

image: "debian:testing"

before_script:
  - apt update; apt install -y --no-install-recommends git build-essential ca-certificates meson cmake libgtk-4-dev libnghttp2-dev libsqlite3-dev libpsl-dev glib-networking curl
  # compile libsoup3
  - git clone --recursive https://gitlab.gnome.org/GNOME/libsoup
  - cd libsoup
  - meson build -Dprefix=/usr -Dbrotli=enabled -Ddocs=disabled -Dinstalled_tests=false -Dvapi=disabled
  - cd build
  - ninja install
  - cd ../../

  - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
  - source $HOME/.cargo/env
  - rustup toolchain install nightly --profile minimal --allow-downgrade -c rustfmt

  - git submodule update --init
  - curl --proto '=https' --tlsv1.2 -sSf -o gir-rustdoc.py
    https://gitlab.gnome.org/World/Rust/gir-rustdoc/-/raw/main/gir-rustdoc.py
  - chmod +x gir-rustdoc.py

build:
  script:
    - cargo build --all-features --examples
    - cargo test

docs:
  stage: test
  variables:
    GIT_SUBMODULE_STRATEGY: recursive
  script:
    # generate the docs
    - cargo install rustdoc-stripper
    - ./generator.py --embed-docs
    - rustup default nightly
    - eval $(./gir-rustdoc.py pre-docs)
    - cargo doc --features dox --no-deps
    - mv target/doc/ docs
  artifacts:
    paths:
      - docs

pages:
  stage: deploy
  script:
    - ./gir-rustdoc.py html-index
    # main docs
    - mkdir public/git
    - mv docs public/git/docs
    # stable docs
    # - ./gir-rustdoc.py docs-from-artifacts
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH