Skip to content

Commit

Permalink
chore: Manage dependencies by mise
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Jan 17, 2025
1 parent 4cec4b9 commit bb12546
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,17 @@ 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
environment:
# Mise has an issue on the CI where the rust toolchain has not been updated in a while
#
# It fires parallel jobs that try to install cargo creates and each of these triggers a toolchain update
# These toolchain updates end up writing the same files and one or more of them will error out
MISE_JOBS: 1

install-go-modules:
steps:
Expand All @@ -61,6 +57,7 @@ jobs:
executor: default
steps:
- checkout-with-submodules
- install-dependencies
- run:
name: Check versions
command: just check-monorepo-versions
Expand All @@ -71,6 +68,7 @@ jobs:
FOUNDRY_PROFILE: ci
steps:
- checkout-with-submodules
- install-dependencies
- run:
name: Run Forge build
command: just build-contracts
Expand All @@ -82,7 +80,7 @@ jobs:
executor: default
steps:
- checkout-with-submodules
- install-go-modules
- install-dependencies
- install-golangci-lint
- run:
name: Run linter
Expand All @@ -92,6 +90,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 +108,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
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
22 changes: 22 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tools]

# Core dependencies
go = "1.22.3"
rust = "1.83.0"
just = "1.37.0"

# Go dependencies
"ubi:goreleaser/goreleaser" = "2.5.1"

# Cargo dependencies
"cargo:mdbook" = "0.4.43"
"cargo:mdbook-mermaid" = "0.14.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 bb12546

Please sign in to comment.