diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d7605ddf..5b9106b8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,14 +1,27 @@ version: 2.1 + orbs: slack: circleci/slack@4.10.1 -parameters: - ci_builder_image: - type: string - default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.35.0 - base_image: - type: string - default: ubuntu-2204:2022.07.1 + utils: ethereum-optimism/circleci-utils@0.0.12 + +executors: + default: + machine: + image: ubuntu-2204:2024.08.1 + commands: + install-dependencies: + steps: + - run: + name: Install mise + command: curl https://mise.run | MISE_INSTALL_PATH=/home/circleci/bin/mise sh + - run: + name: Activate mise + command: echo 'eval "$(mise activate bash)"' >> $BASH_ENV + - run: + name: Install mise dependencies + command: mise install + notify-failures-on-develop: description: "Notify Slack" parameters: @@ -21,37 +34,57 @@ commands: event: fail template: basic_fail_1 branch_pattern: develop + jobs: lint-specs: - docker: - - image: <> + executor: default steps: - checkout - - run: - name: Install pnpm - command: npm install -g pnpm@9.1.0 - - run: - name: Install deps - command: just deps + - install-dependencies - run: name: markdown lint command: just lint-specs-md-check - run: name: markdown toc command: just lint-specs-toc-check - - run: - name: build book - command: just build + lint-links: - machine: - image: <> + executor: default steps: - checkout + - install-dependencies - run: name: Lint check command: just lint-links - notify-failures-on-develop: channel: C055R639XT9 #notify-link-check + + build-book: + executor: default + steps: + - checkout + - install-dependencies + - run: + name: Build + command: just build + - run: + name: Add CNAME file + command: echo "specs.optimism.io" > ./book/html/CNAME + - persist_to_workspace: + root: ./book + paths: + - html + + publish-book: + executor: default + steps: + - checkout + - attach_workspace: + at: /tmp/book + - utils/get-github-access-token + - utils/github-pages-deploy: + src-pages-dir: /tmp/book/html + workflows: specs-check: when: @@ -59,9 +92,23 @@ workflows: equal: [scheduled_pipeline, << pipeline.trigger_source >>] jobs: - lint-specs + - build-book + scheduled-links-check: when: equal: [build_daily, <>] jobs: - lint-links: context: slack + + publish: + jobs: + - build-book: + filters: + branches: + only: main + - publish-book: + requires: + - build-book + context: + - circleci-repo-specs diff --git a/README.md b/README.md index 26c506cce..19d9a0b04 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,26 @@ We welcome your contributions. Read through [CONTRIBUTING.md](./CONTRIBUTING.md) ### Dependencies +#### Using `mise` + +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 +``` + +#### Manual installation + **Rust Toolchain** ```sh diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..e7d9067cf --- /dev/null +++ b/mise.toml @@ -0,0 +1,23 @@ +[tools] + +# Core dependencies +rust = "1.83.0" +just = "1.37.0" +node = "20.9.0" + +# Cargo dependencies +"cargo:mdbook" = "0.4.43" +"cargo:mdbook-katex" = "0.9.2" +"cargo:mdbook-linkcheck" = "0.7.7" +"cargo:mdbook-mermaid" = "0.14.1" + +[hooks] +postinstall = [ + # Enabling corepack will install the `pnpm` package manager specified in package.json + 'npx corepack enable', + 'pnpm i --frozen-lockfile' +] + +[settings] +# Needs to be enabled for hooks to work +experimental = true \ No newline at end of file diff --git a/package.json b/package.json index 7b27f9053..596cd95d3 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,6 @@ "doctoc": "^2.2.1", "markdownlint-cli2": "0.4.0", "cspell": "^8.1.3" - } + }, + "packageManager": "pnpm@9.15.4" }