Skip to content

Commit

Permalink
chore: Add mise dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Jan 17, 2025
1 parent 4cec4b9 commit e7b5e77
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -61,6 +51,7 @@ jobs:
executor: default
steps:
- checkout-with-submodules
- install-dependencies
- run:
name: Check versions
command: just check-monorepo-versions
Expand All @@ -71,6 +62,7 @@ jobs:
FOUNDRY_PROFILE: ci
steps:
- checkout-with-submodules
- install-dependencies
- run:
name: Run Forge build
command: just build-contracts
Expand All @@ -82,7 +74,7 @@ jobs:
executor: default
steps:
- checkout-with-submodules
- install-go-modules
- install-dependencies
- install-golangci-lint
- run:
name: Run linter
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
set positional-arguments

build-book:
mdbook build ./docs

build-contracts:
forge --version
forge build --sizes --root ./contracts
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions mise.book.toml
Original file line number Diff line number Diff line change
@@ -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"
18 changes: 18 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -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]"

0 comments on commit e7b5e77

Please sign in to comment.