forked from linera-io/linera-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (84 loc) · 2.7 KB
/
documentation.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
91
92
93
94
name: Documentation
on:
push:
branches: [ main ]
paths-ignore:
- '*.md'
- 'docker/**'
- 'docker_scylla/**'
- 'configuration/**'
- 'kubernetes/**'
- 'scripts/**'
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs on pull-requests
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.run_id }}'
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
LINERA_CRATES: base chain core execution rpc sdk sdk-derive service service-graphql-client storage version views views-derive witty witty-macros
VERSION: 0.1.0
permissions:
contents: read
jobs:
publish-docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compute docs
run: |
cargo doc --all-features
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./target/doc
force_orphan: true
# TODO(#802): Fix this job.
# docsrs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rust-lang/setup-rust-toolchain@v1
# - name: Checkout docs.rs tool repository
# run: |
# cd ${{ runner.temp }}
# git clone https://github.com/rust-lang/docs.rs docsrs
# cd docsrs
# git submodule update --init
# - name: Generate standalone packages
# run: |
# for crate in $LINERA_CRATES; do
# cargo publish -p "linera-${crate}" --dry-run --target-dir "${{ runner.temp }}/crates/linera-${crate}" --no-verify
# done
#
# - name: Extract packaged crates
# run: |
# for crate in $LINERA_CRATES; do
# pushd "${{ runner.temp }}/crates/linera-${crate}/package"
# tar -xzvf "linera-${crate}-${VERSION}.crate"
# popd
# done
# - name: Build documentation using docs.rs
# run: |
# cd ${{ runner.temp }}/docsrs
# cp .env.sample .env
# mkdir -p ignored/cratesfyi-prefix/crates.io-index
# . ./.env
# docker-compose up -d db s3
# cargo run -- database migrate
# for crate in $LINERA_CRATES; do
# cargo run -- build crate --local "${{ runner.temp }}/crates/linera-${crate}/package/linera-${crate}-${VERSION}"
# done