-
Notifications
You must be signed in to change notification settings - Fork 27
66 lines (55 loc) · 2.1 KB
/
docs.yml
File metadata and controls
66 lines (55 loc) · 2.1 KB
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
name: docs
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain
with:
toolchain: nightly
- name: Fetch dependencies and patch generic-array
run: |
# Fetch dependencies first to download the crates
cargo fetch
# Now patch crates that use doc_auto_cfg
# Patch generic-array crate
find ~/.cargo/registry/src -name "lib.rs" -path "*/generic-array-*/src/lib.rs" -exec \
sed -i 's/doc_auto_cfg/doc_cfg/g' {} \; || true
# Patch getrandom crate
find ~/.cargo/registry/src -name "lib.rs" -path "*/getrandom-*/src/lib.rs" -exec \
sed -i 's/doc_auto_cfg/doc_cfg/g' {} \; || true
# Patch winnow crate (remove doc_auto_cfg line entirely since it already has doc_cfg)
find ~/.cargo/registry/src -name "lib.rs" -path "*/winnow-*/src/lib.rs" -exec \
sed -i '/doc_auto_cfg/d' {} \; || true
# Patch toml_datetime crate
find ~/.cargo/registry/src -name "lib.rs" -path "*/toml_datetime-*/src/lib.rs" -exec \
sed -i 's/doc_auto_cfg/doc_cfg/g' {} \; || true
# Patch toml_edit crate
find ~/.cargo/registry/src -name "lib.rs" -path "*/toml_edit-*/src/lib.rs" -exec \
sed -i 's/doc_auto_cfg/doc_cfg/g' {} \; || true
- env:
RUSTFLAGS: --cfg docsrs
RUSTDOCFLAGS: --cfg docsrs
run: cargo doc --package oo7 --features "unstable" --no-deps
- name: Fix permissions
run: |
chmod -c -R +rX "target/doc/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload docs artifact
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: docs-reports
path: ./target/doc/
retention-days: 30