diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f2be413..9720b6dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,21 +34,11 @@ commands: name: Setup golangci-lint command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin << parameters.version >> - install-goreleaser: - parameters: - version: - type: string - default: "2.5.1" + install-dependencies: steps: - run: - name: Install GoReleaser - command: | - echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list - apt -q update -y - apt -q install -y --no-install-recommends goreleaser=<< parameters.version >> - - run: - name: Output GoReleaser version - command: goreleaser --version + name: Install mise dependencies + command: mise install install-go-modules: steps: @@ -61,6 +51,7 @@ jobs: executor: default steps: - checkout-with-submodules + - install-dependencies - run: name: Check versions command: just check-monorepo-versions @@ -71,6 +62,7 @@ jobs: FOUNDRY_PROFILE: ci steps: - checkout-with-submodules + - install-dependencies - run: name: Run Forge build command: just build-contracts @@ -82,7 +74,7 @@ jobs: executor: default steps: - checkout-with-submodules - - install-go-modules + - install-dependencies - install-golangci-lint - run: name: Run linter @@ -92,6 +84,7 @@ jobs: executor: default steps: - checkout-with-submodules + - install-dependencies - install-go-modules - run: # We need to "rename" some of the variables coming from the CircleCI context @@ -109,10 +102,12 @@ jobs: executor: default steps: - checkout-with-submodules - - install-goreleaser + - install-dependencies - install-go-modules - utils/get-github-access-token: - # GoReleaser expects a GITHUB_TOKEN environment variable to be set + # GoReleaser uses the GITHUB_TOKEN environment variable to authenticate with GitHub + # + # It's important that the token has write permissions both to this repository and to the homebrew-tap repository output-token-name: GITHUB_TOKEN - run: name: Run GoReleaser diff --git a/Justfile b/Justfile index 2e5f9225..9a4a5d3b 100644 --- a/Justfile +++ b/Justfile @@ -1,5 +1,8 @@ set positional-arguments +build-book: + mdbook build ./docs + build-contracts: forge --version forge build --sizes --root ./contracts diff --git a/README.md b/README.md index 107242b7..1db79119 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,24 @@ L2s: Predeploy Contracts Spec ( https://specs.optimism.io/protocol/predeploys.ht ### Development +#### Software dependencies + +We use [`mise`](https://mise.jdx.dev/) as a dependency manager for these tools. +Once properly installed, `mise` will provide the correct versions for each tool. `mise` does not +replace any other installations of these binaries and will only serve these binaries when you are +working inside of the `optimism` directory. + +##### Install `mise` + +Install `mise` by following the instructions provided on the +[Getting Started page](https://mise.jdx.dev/getting-started.html#_1-install-mise-cli). + +##### Install dependencies + +```sh +mise install +``` + #### Running locally ```sh diff --git a/mise.book.toml b/mise.book.toml new file mode 100644 index 00000000..ccfb1868 --- /dev/null +++ b/mise.book.toml @@ -0,0 +1,12 @@ +# These dependencies are only required if you want to build the book + +[tools] + +# Cargo dependencies +"cargo:mdbook" = "0.4.43" +"cargo:mdbook-mermaid" = "0.14.1" + +[env] +# On CI, when using the ci-builder image, we need to set the toolchain explicitly +# so that we avoid the "rustup could not choose a version of cargo to run, because one wasn't specified explicitly" error +RUSTUP_TOOLCHAIN = "1.83.0" \ No newline at end of file diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..f9f9c39f --- /dev/null +++ b/mise.toml @@ -0,0 +1,18 @@ +[tools] + +# Core dependencies +go = "1.22.3" +rust = "1.83.0" +just = "1.37.0" + +# Go dependencies +"ubi:goreleaser/goreleaser" = "2.5.1" + +# Foundry +"ubi:foundry-rs/foundry[exe=forge]" = "nightly-59f354c179f4e7f6d7292acb3d068815c79286d1" + +# Foundry provides multiple binaries so we alias them here +[alias] +forge = "ubi:foundry-rs/foundry[exe=forge]" +cast = "ubi:foundry-rs/foundry[exe=cast]" +anvil = "ubi:foundry-rs/foundry[exe=anvil]" \ No newline at end of file