flake.nix
: use a Nix package to facilitate sharing (#2016)
#1034
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.ref }}' | |
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 |