-
-
Notifications
You must be signed in to change notification settings - Fork 113
90 lines (86 loc) · 3.43 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
release:
types: [published]
name: docs
jobs:
docs:
runs-on: ubuntu-latest
name: build
env:
RELEASES: |
0.17=0.17
0.16=0.16
0.15=0.15
0.14=0.14
RUSTFLAGS: --cfg docsrs
RUSTDOCFLAGS: --cfg docsrs
steps:
- uses: actions/checkout@v3
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: ./