Skip to content

Add Cargo.lock to git tracking #3188

Add Cargo.lock to git tracking

Add Cargo.lock to git tracking #3188

Workflow file for this run

on:
push:
branches: [master]
pull_request:
workflow_dispatch:
release:
types: [published]
name: docs
jobs:
docs:
runs-on: ubuntu-latest
name: build
env:
RELEASES: |
0.18=0.18
0.17=0.17
0.16=0.16
0.15=0.15
0.14=0.14
RUSTFLAGS: --cfg docsrs
RUSTDOCFLAGS: --cfg docsrs -Zunstable-options --generate-link-to-definition
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
set-safe-directory: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- run: git submodule update --checkout
- run: cargo install rustdoc-stripper
- run: python3 ./generator.py --embed-docs --yes ./
- run: git clone https://gitlab.gnome.org/World/Rust/gir-rustdoc/ # checkout action doesn't support random urls
- run: echo "RUSTDOCFLAGS=$(eval python3 ./gir-rustdoc/gir-rustdoc.py --pages-url 'https://gtk-rs.org/gtk-rs-core/' --default-branch 'master' pre-docs | xargs)" >> ${GITHUB_ENV}
- uses: actions-rs/cargo@v1
with:
command: doc
args: >
-p cairo-rs
-p cairo-sys-rs
-p gdk-pixbuf
-p gdk-pixbuf-sys
-p gio
-p gio-sys
-p glib
-p gobject-sys
-p glib-sys
-p glib-macros
-p glib-build-tools
-p graphene-rs
-p graphene-sys
-p pango
-p pango-sys
-p pangocairo
-p pangocairo-sys
--no-deps
--all-features
- run: echo "RELEASE=$(echo '${{ github.event.release.tag_name }}' | grep -Po '(\d+)\.(\d+)')" >> ${GITHUB_ENV}
- run: echo "DEST=$(if [ "$GITHUB_EVENT_NAME" == "release" ]; then echo 'stable/${{ env.RELEASE }}'; else echo 'git'; fi)" >> ${GITHUB_ENV}
- name: Grab gtk-rs LOGO
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
run: |
wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs-16.png -O ./target/doc/favicon-16x16.png
wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs-32.png -O ./target/doc/favicon-32x32.png
wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs-256.png -O ./target/doc/rust-logo.png
wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs.svg -O ./target/doc/rust-logo.svg
wget https://raw.githubusercontent.com/gtk-rs/gtk-rs.github.io/master/logo/gtk-rs.svg -O ./target/doc/favicon.svg
- name: deploy
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc/
keep_files: false
destination_dir: ${{ env.DEST }}/docs
- run: python3 ./gir-rustdoc/gir-rustdoc.py --project-title 'GTK Core Rust bindings' html-index
- name: deploy index page
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public/
keep_files: true
destination_dir: ./