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..34a75ee4 100644 --- a/.github/workflows/devnet.yaml +++ b/.github/workflows/devnet.yaml @@ -28,8 +28,29 @@ jobs: node-version: 20 cache: "pnpm" + - name: Capture anvil version from @cartesi/rollups-contracts release + id: anvil-version + working-directory: packages/devnet + env: + GH_TOKEN: ${{ github.token }} + 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").version' + )" + + 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