Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEB3-321: feat: deploy steel docs on github pages #419

Merged
merged 20 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/steel-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Deploy Steel Documentation

on:
push:
tags:
- 'v[0-9]+.[0-9]+*' # matches v1.0, v1.1, v2.0, v2.1.0, etc.

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

env:
RISC0_TOOLCHAIN_VERSION: r0.1.81.0
RISC0_MONOREPO_REF: "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :"
- uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v4

- uses: risc0/risc0/.github/actions/rustup@main
with:
toolchain: nightly-2024-09-04

- name: Build documentation
run: |
if ! cargo +nightly-2024-09-04 doc -p risc0-steel --all-features --no-deps; then
echo "Documentation build failed"
exit 1
fi
env:
RISC0_SKIP_BUILD: true
RISC0_SKIP_BUILD_KERNEL: true
RUSTDOCFLAGS: "--cfg docsrs -D warnings"

- name: Setup doc directory structure
run: |
cd target/doc || exit 1

# Create the risc0_steel directory first
mkdir -p risc0_steel

# Find all image references and create symlinks with proper relative paths
for img in $(find ../../crates -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.gif" -o -name "*.svg" \)); do
filename=$(basename $img)
# Create absolute path symlinks in root doc directory
ln -sf $(realpath $img) $filename
# Create relative path symlinks in risc0_steel directory
ln -sf $(realpath $img) risc0_steel/$filename
done

- name: Create index.html redirect
run: |
echo '<meta http-equiv="refresh" content="0; url=risc0_steel/index.html">' > target/doc/index.html

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: target/doc

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
36 changes: 18 additions & 18 deletions crates/steel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@ This documentation covers the core concepts of Steel. After reading, you will un

The RISC Zero [dev docs][dev-docs] are a great place to start to understand the zkVM in detail. If you have any questions, and/or just want to hang out with other builders, please join the [RISC Zero Discord][risczero-discord].

[Steel examples]: ../../examples
[ERC20 Counter]: ../../examples/erc20-counter
[create-steel-app]: docs/create-steel-app
[Steel examples]: https://github.com/risc0/risc0-ethereum/blob/main/examples
[ERC20 Counter]: https://github.com/risc0/risc0-ethereum/blob/main/examples/erc20-counter
[create-steel-app]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/create-steel-app
[video tutorial]: https://www.loom.com/share/0e2ede7b9d50464fb729819a8bd24e05?sid=3009618b-38ea-449a-90dc-9b39ef569c67
[Introducing Steel 1.0]: https://risczero.com/blog/introducing-steel-1.0
[What is Steel?]: docs/what-is-steel.md
[How does Steel work?]: docs/how-does-steel-work.md
[Proving EVM execution within the zkVM]: docs/how-does-steel-work.md#proving-evm-execution-within-the-zkvm
[Verifying the Proof On-Chain]: docs/how-does-steel-work.md#verifying-the-proof-on-chain
[Steel Commitments]: docs/steel-commitments.md
[Trust Anchor: The Blockhash]: docs/steel-commitments.md#steels-trust-anchor-the-blockhash
[What is a Steel Commitment?]: docs/steel-commitments.md#what-is-a-steel-commitment
[Validation of Steel Commitments]: docs/steel-commitments.md#validation-of-steel-commitments
[Steel History]: docs/steel-history.md
[Why use Steel history?]: docs/steel-history.md#why-use-steel-history
[Overview]: docs/steel-history.md#overview
[How does Steel history work?]: docs/steel-history.md#how-does-steel-history-work
[How far can you go back?]: docs/steel-history.md#how-far-can-you-go-back
[How much does Steel history cost?]: docs/steel-history.md#how-much-does-steel-history-cost
[Enabling Steel history]: docs/steel-history.md#enabling-steel-history
[What is Steel?]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/what-is-steel.md
[How does Steel work?]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/how-does-steel-work.md
[Proving EVM execution within the zkVM]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/how-does-steel-work.md#proving-evm-execution-within-the-zkvm
[Verifying the Proof On-Chain]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/how-does-steel-work.md#verifying-the-proof-on-chain
[Steel Commitments]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-commitments.md
[Trust Anchor: The Blockhash]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-commitments.md#steels-trust-anchor-the-blockhash
[What is a Steel Commitment?]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-commitments.md#what-is-a-steel-commitment
[Validation of Steel Commitments]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-commitments.md#validation-of-steel-commitments
[Steel History]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-history.md
[Why use Steel history?]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-history.md#why-use-steel-history
[Overview]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-history.md#overview
[How does Steel history work?]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-history.md#how-does-steel-history-work
[How far can you go back?]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-history.md#how-far-can-you-go-back
[How much does Steel history cost?]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-history.md#how-much-does-steel-history-cost
[Enabling Steel history]: https://github.com/risc0/risc0-ethereum/blob/main/crates/steel/docs/steel-history.md#enabling-steel-history
[dev-docs]: https://dev.risczero.com/api/
[risczero-discord]: https://discord.com/invite/risczero
6 changes: 3 additions & 3 deletions crates/steel/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use revm::{
///
/// ### Usage
/// - **Preflight calls on the Host:** To prepare calls on the host environment and build the
/// necessary proof, use [Contract::preflight]. The environment can be initialized using the
/// necessary proof, use [Contract::preflight][Contract]. The environment can be initialized using the
/// [EthEvmEnv::builder] or [EvmEnv::builder].
/// - **Calls in the Guest:** To initialize the contract in the guest environment, use
/// [Contract::new]. The environment should be constructed using [EvmInput::into_env].
Expand Down Expand Up @@ -69,8 +69,8 @@ use revm::{
/// # }
/// ```
///
/// [EthEvmEnv::builder]: crate::ethereum::EthEvmEnv::builder
/// [EvmEnv::builder]: crate::EvmEnv::builder
/// [EthEvmEnv::builder]: crate::ethereum::EthEvmEnv
/// [EvmEnv::builder]: crate::EvmEnv
/// [EvmInput::into_env]: crate::EvmInput::into_env
pub struct Contract<E> {
address: Address,
Expand Down
Loading