Skip to content
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
55 changes: 55 additions & 0 deletions .github/actions/rustup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: rustup toolchain install
description: Install the Rust toolchain

inputs:
toolchain:
description: 'Identifier of the rust toolchain to install'
required: false
default: 'stable'
type: string
targets:
description: 'Rust compiler targets to install, as a space-delimited list'
required: false
default: ''
type: string
components:
description: 'List of components to install via rustup, as a space-delimited list'
required: false
default: ''
type: string

runs:
using: composite
steps:
- run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
shell: bash

- run: rustup override unset
shell: bash

- run: rustup default ${{ inputs.toolchain }}
shell: bash

- if: ${{ inputs.targets != '' }}
run: rustup target add ${{ inputs.targets }}
shell: bash

- if: ${{ inputs.components != '' }}
run: rustup component add ${{ inputs.components }}
shell: bash

- run: |
echo "CARGO_NET_RETRY=10" >> $GITHUB_ENV
echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV
echo "RUSTUP_MAX_RETRIES=10" >> $GITHUB_ENV
shell: bash

- run: rustup show active-toolchain || rustup toolchain install
shell: bash

- run: rustc --version --verbose
shell: bash
40 changes: 40 additions & 0 deletions .github/containers/release/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:22.04 as base

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt -y install \
build-essential \
cmake \
curl \
git \
libssl-dev \
ninja-build \
pkg-config \
python3 \
zlib1g-dev

RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV RISC0_HOME="/risc0"

WORKDIR /src

FROM base AS builder
COPY . .

RUN ls -al rust/.git

WORKDIR /src/risc0
RUN --mount=type=cache,id=release,target=/root/.cache \
--mount=type=cache,id=release,target=/root/.cargo,from=base,source=/root/.cargo \
cargo build --bin rzup

RUN mkdir -p /risc0

RUN --mount=type=cache,id=release,target=/root/.cache \
--mount=type=cache,id=release,target=/root/.cargo,from=base,source=/root/.cargo \
target/debug/rzup build rust --path /src/rust

FROM scratch AS export
COPY --from=builder /risc0/toolchains/ /
Loading
Loading