-
Notifications
You must be signed in to change notification settings - Fork 28
70 lines (57 loc) · 2.36 KB
/
docs.yml
File metadata and controls
70 lines (57 loc) · 2.36 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
67
68
69
70
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@v6
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- 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
# Patch rand_core crate
find ~/.cargo/registry/src -name "lib.rs" -path "*/rand_core-*/src/lib.rs" -exec \
sed -i 's/doc_auto_cfg/doc_cfg/g' {} \; || true
# Patch socket2 crate
find ~/.cargo/registry/src -name "lib.rs" -path "*/socket2-*/src/lib.rs" -exec \
sed -i 's/doc_auto_cfg/doc_cfg/g' {} \; || true
- run: cargo docs-rs --package oo7
- 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@v5
with:
name: docs-reports
path: ./target/doc/
retention-days: 30