Skip to content

Commit

Permalink
ci(devnet): lock anvil version
Browse files Browse the repository at this point in the history
  • Loading branch information
endersonmaia committed Oct 31, 2024
1 parent dae7520 commit 041c418
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/olive-buckets-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/devnet": major
---

lock anvil version in CI to the same anvil used by cartesi/rollups-contracts
21 changes: 21 additions & 0 deletions .github/workflows/devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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-(?<version>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
Expand Down

0 comments on commit 041c418

Please sign in to comment.