From deb11f88dee9a4d9c680ce29ea9f796e2c1a2dcc Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Thu, 31 Oct 2024 15:16:58 -0300 Subject: [PATCH] ci(devnet): lock anvil version --- .changeset/olive-buckets-lay.md | 5 +++++ .github/workflows/devnet.yaml | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .changeset/olive-buckets-lay.md diff --git a/.changeset/olive-buckets-lay.md b/.changeset/olive-buckets-lay.md new file mode 100644 index 00000000..ac6c5a9d --- /dev/null +++ b/.changeset/olive-buckets-lay.md @@ -0,0 +1,5 @@ +--- +"@cartesi/devnet": major +--- + +lock anvil version in CI to the same anvil used by cartesi/rollups-contracts diff --git a/.github/workflows/devnet.yaml b/.github/workflows/devnet.yaml index 67a1e49b..0517bcf7 100644 --- a/.github/workflows/devnet.yaml +++ b/.github/workflows/devnet.yaml @@ -28,8 +28,27 @@ jobs: node-version: 20 cache: "pnpm" + - name: Capture anvil version from @cartesi/rollups-contracts release + id: anvil-version + working-directory: packages/devnet + run: | + CARTESI_ROLLUPS_CONTRACTS_VERSION="$(jq -r '.devDependencies."@cartesi/rollups"' package.json)" + ANVIL_NIGHTLY_VERSION="$( + gh release view v${CARTESI_ROLLUPS_CONTRACTS_VERSION} \ + --repo cartesi/rollups-contracts \ + --json assets \ + --jq '.assets[] | select(.name | contains("anvil")) | .name | capture(".*-anvil-nightly-(?[a-f0-9]{40})\\.tar\\.gz").hash' + )" + + printf "Detected @cartesi/rollups-contracts version: %s\n" "${CARTESI_ROLLUPS_CONTRACTS_VERSION}" + printf "Detected anvil nightly version: %s\n" "${ANVIL_NIGHTLY_VERSION}" + + echo "ANVIL_VERSION=${ANVIL_NIGHTLY_VERSION}" >> "$GITHUB_OUTPUT" + - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 + with: + version: ${{ steps.anvil-version.outputs.ANVIL_VERSION }} - name: Install dependencies run: pnpm install