Skip to content

ci(devnet): lock anvil version for devnet ci build #30

ci(devnet): lock anvil version for devnet ci build

ci(devnet): lock anvil version for devnet ci build #30

Workflow file for this run

name: devnet
on:
pull_request:
paths:
- .github/workflows/devnet.yaml
- packages/devnet/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: read
packages: write
actions: write
jobs:
build:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
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-(?<hash>[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
- name: Build
run: pnpm build --filter @cartesi/devnet