ci(devnet): lock anvil version for devnet ci build #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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 | |
- name: Build | |
run: pnpm build --filter @cartesi/devnet |