Commit 6d87eb7c authored by Maurelian's avatar Maurelian Committed by GitHub

Add a .foundryrc file for setting the version (#6162)

* feat: Add a .foundryrc file for setting the version

feat: Add install:foundry script

* feat: Update ci-builder dockerfile
parent 135f0809
3b1129b5bc43ba22a9bcf4e4323c5a9df0023140
...@@ -45,7 +45,7 @@ This tutorial was checked on: ...@@ -45,7 +45,7 @@ This tutorial was checked on:
| Go | 1.20 | `sudo apt update` <br> `wget https://go.dev/dl/go1.20.linux-amd64.tar.gz` <br> `tar xvzf go1.20.linux-amd64.tar.gz` <br> `sudo cp go/bin/go /usr/bin/go` <br> `sudo mv go /usr/lib` <br> `echo export GOROOT=/usr/lib/go >> ~/.bashrc` | Go | 1.20 | `sudo apt update` <br> `wget https://go.dev/dl/go1.20.linux-amd64.tar.gz` <br> `tar xvzf go1.20.linux-amd64.tar.gz` <br> `sudo cp go/bin/go /usr/bin/go` <br> `sudo mv go /usr/lib` <br> `echo export GOROOT=/usr/lib/go >> ~/.bashrc`
| Node | 16.19.0 | `curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -` <br> `sudo apt-get install -y nodejs npm` | Node | 16.19.0 | `curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -` <br> `sudo apt-get install -y nodejs npm`
| yarn | 1.22.19 | `sudo npm install -g yarn` | yarn | 1.22.19 | `sudo npm install -g yarn`
| Foundry | 0.2.0 | `curl -L https://foundry.paradigm.xyz | bash` <br> `. ~/.bashrc` <br> `foundryup` | Foundry | 0.2.0 | `yarn install:foundry`
## Build the Source Code ## Build the Source Code
......
...@@ -11,12 +11,14 @@ RUN apt-get update && \ ...@@ -11,12 +11,14 @@ RUN apt-get update && \
chmod +x ./rustup.sh && \ chmod +x ./rustup.sh && \
./rustup.sh -y ./rustup.sh -y
# move the foundryrc file to the foundry dir
WORKDIR /opt/foundry WORKDIR /opt/foundry
COPY ../../.foundryrc ./.foundryrc
# Only diff from upstream docker image is this clone instead # Only diff from upstream docker image is this clone instead
# of COPY. We select a specific commit to use. # of COPY. We select a specific commit to use.
RUN git clone https://github.com/foundry-rs/foundry.git . \ RUN git clone https://github.com/foundry-rs/foundry.git . \
&& git checkout 3b1129b5bc43ba22a9bcf4e4323c5a9df0023140 && git checkout $(cat .foundryrc)
RUN source $HOME/.profile && \ RUN source $HOME/.profile && \
cargo build --release && \ cargo build --release && \
......
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
"ready": "yarn lint && yarn test", "ready": "yarn lint && yarn test",
"prepare": "husky install", "prepare": "husky install",
"release": "yarn build && yarn changeset publish", "release": "yarn build && yarn changeset publish",
"update:yarn": "yarn set version 1.x" "update:yarn": "yarn set version 1.x",
"install:foundry": "curl -L https://foundry.paradigm.xyz | bash && yarn update:foundry",
"update:foundry": "foundryup -C $(cat .foundryrc)"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.18.2", "@babel/eslint-parser": "^7.18.2",
......
...@@ -56,16 +56,17 @@ npm install @eth-optimism/contracts-bedrock ...@@ -56,16 +56,17 @@ npm install @eth-optimism/contracts-bedrock
We work on this repository with a combination of [Hardhat](https://hardhat.org) and [Foundry](https://getfoundry.sh/). We work on this repository with a combination of [Hardhat](https://hardhat.org) and [Foundry](https://getfoundry.sh/).
1. Install Foundry by following [the instructions located here](https://getfoundry.sh/). 1. Install node modules with yarn (v1) and Node.js (16+):
A specific version must be used.
```shell ```shell
foundryup -C 3b1129b5bc43ba22a9bcf4e4323c5a9df0023140 yarn install
``` ```
2. Install node modules with yarn (v1) and Node.js (16+):
1. Install the correct version of foundry (defined in the .foundryrc file in the root of this repo.
```shell
yarn install ```shell
``` yarn install:foundry
```
### Build ### Build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment