Skip to content

[aikido] fix: upgrade react native community cli for with-crossmint repo #146

[aikido] fix: upgrade react native community cli for with-crossmint repo

[aikido] fix: upgrade react native community cli for with-crossmint repo #146

Workflow file for this run

name: Build Examples
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
any: ${{ steps.set.outputs.any }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3.0.3
id: filter
with:
# Each key maps to a path pattern. Workflow-file changes rebuild all.
filters: |
with-react:
- 'with-react/**'
- '.github/workflows/build.yml'
with-next-app-router:
- 'with-next-app-router/**'
- '.github/workflows/build.yml'
with-next-page-router:
- 'with-next-page-router/**'
- '.github/workflows/build.yml'
with-dynamic:
- 'with-dynamic/**'
- '.github/workflows/build.yml'
with-farcaster:
- 'with-farcaster/**'
- '.github/workflows/build.yml'
with-metamask:
- 'with-metamask/**'
- '.github/workflows/build.yml'
with-porto:
- 'with-porto/**'
- '.github/workflows/build.yml'
with-tempo:
- 'with-tempo/**'
- '.github/workflows/build.yml'
with-privy:
- 'with-privy/**'
- '.github/workflows/build.yml'
with-reown:
- 'with-reown/**'
- '.github/workflows/build.yml'
with-thirdweb:
- 'with-thirdweb/**'
- '.github/workflows/build.yml'
with-web3-onboard:
- 'with-web3-onboard/**'
- '.github/workflows/build.yml'
with-react-native:
- 'with-react-native/**'
- '.github/workflows/build.yml'
with-solana:
- 'with-solana/**'
- '.github/workflows/build.yml'
with-angular:
- 'with-angular/**'
- '.github/workflows/build.yml'
with-crossmint:
- 'with-crossmint/**'
- '.github/workflows/build.yml'
with-openfort:
- 'with-openfort/**'
- '.github/workflows/build.yml'
with-turnkey:
- 'with-turnkey/**'
- '.github/workflows/build.yml'
# Build the matrix from a static config, filtered to changed examples.
# The matrix is consumed via `needs` (allowed in jobs.<id>.strategy);
# `matrix` itself is NOT available in jobs.<id>.if, so gating happens
# here by emitting only the changed entries.
- id: set
env:
CHANGED: ${{ steps.filter.outputs.changes }}
run: |
FULL='[
{"name":"with-react","dir":"with-react","pm":"pnpm","build":"build","node":"22"},
{"name":"with-next-app-router","dir":"with-next-app-router","pm":"pnpm","build":"next:build","node":"22"},
{"name":"with-next-page-router","dir":"with-next-page-router","pm":"pnpm","build":"build","node":"22"},
{"name":"with-dynamic","dir":"with-dynamic","pm":"pnpm","build":"build","node":"22","audit":"critical"},
{"name":"with-farcaster","dir":"with-farcaster","pm":"pnpm","build":"build","node":"22"},
{"name":"with-metamask","dir":"with-metamask","pm":"pnpm","build":"build","node":"22"},
{"name":"with-porto","dir":"with-porto","pm":"pnpm","build":"build","node":"22"},
{"name":"with-tempo","dir":"with-tempo","pm":"pnpm","build":"build","node":"22"},
{"name":"with-privy","dir":"with-privy","pm":"pnpm","build":"build","node":"22"},
{"name":"with-reown","dir":"with-reown","pm":"pnpm","build":"build","node":"22"},
{"name":"with-thirdweb","dir":"with-thirdweb","pm":"pnpm","build":"build","node":"22"},
{"name":"with-web3-onboard","dir":"with-web3-onboard","pm":"pnpm","build":"build","node":"22"},
{"name":"with-react-native","dir":"with-react-native","pm":"pnpm","build":"typecheck","node":"22","audit":"critical"},
{"name":"with-solana","dir":"with-solana","pm":"pnpm","build":"build","node":"22"},
{"name":"with-angular","dir":"with-angular","pm":"pnpm","build":"build","node":"22"},
{"name":"with-crossmint","dir":"with-crossmint","pm":"pnpm","build":"build","node":"22","audit":"critical"},
{"name":"with-openfort","dir":"with-openfort/frontend","pm":"pnpm","build":"build","node":"22"},
{"name":"with-turnkey","dir":"with-turnkey","pm":"pnpm","build":"build","node":"22"}
]'
MATRIX=$(jq -cn --argjson full "$FULL" --argjson changed "$CHANGED" \
'{include: [ $full[] | select(.name as $n | ($changed | index($n)) != null) ]}')
echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
echo "any=$(jq -n --argjson m "$MATRIX" '($m.include | length) > 0')" >> "$GITHUB_OUTPUT"
echo "Selected: $MATRIX"
build:
needs: changes
if: ${{ needs.changes.outputs.any == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.changes.outputs.matrix) }}
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node }}
- name: Install pnpm
if: matrix.pm == 'pnpm'
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
version: 11
- name: Install bun
if: matrix.pm == 'bun'
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Setup env files
working-directory: ${{ matrix.dir }}
shell: bash
run: |
if [ -f .env.example ]; then
sed 's/=$/=ci_test_key/' .env.example | \
sed 's/=your_[a-z_]*_here$/=ci_test_key/' | \
sed 's/="your_[a-z_]*"$/=ci_test_key/' | \
sed 's/=your-[a-z-]*$/=ci_test_key/' > .env
fi
- name: Setup nested env (next-app-router)
if: matrix.name == 'with-next-app-router'
shell: bash
run: |
echo "NEXT_PUBLIC_FORMO_ANALYTICS_WRITE_KEY=ci_test_key" > with-next-app-router/packages/nextjs/.env
- name: Install dependencies
working-directory: ${{ matrix.dir }}
shell: bash
env:
PM: ${{ matrix.pm }}
HUSKY: "0"
run: |
case "$PM" in
yarn) yarn install --frozen-lockfile ;;
yarn-berry) yarn install ;;
pnpm) pnpm install --frozen-lockfile ;;
bun) bun install --frozen-lockfile ;;
npm-legacy-peer-deps) npm ci --legacy-peer-deps ;;
*) npm ci ;;
esac
- name: Build
# Crossmint's SDK cryptographically validates the API key at build-time
# during prerender, so a synthetic placeholder can't get the build past
# static generation. The audit job still covers `with-crossmint`.
if: matrix.name != 'with-crossmint'
working-directory: ${{ matrix.dir }}
shell: bash
env:
BUILD_SCRIPT: ${{ matrix.build }}
PM: ${{ matrix.pm }}
CI: false
run: |
case "$PM" in
yarn|yarn-berry) yarn "$BUILD_SCRIPT" ;;
pnpm) pnpm run "$BUILD_SCRIPT" ;;
bun) bun run "$BUILD_SCRIPT" ;;
*) npm run "$BUILD_SCRIPT" ;;
esac
# Parallel to `build`. Reuses the same matrix so audit only runs against
# changed examples. Fails the PR on high/critical advisories; moderate and
# low are still printed but don't break the check (tune `--audit-level` to
# `moderate` later if stricter coverage is wanted).
audit:
needs: changes
if: ${{ needs.changes.outputs.any == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.changes.outputs.matrix) }}
name: audit (${{ matrix.name }})
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node }}
- name: Install pnpm
if: matrix.pm == 'pnpm'
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
version: 11
- name: Audit production dependencies
if: matrix.pm == 'pnpm'
working-directory: ${{ matrix.dir }}
shell: bash
env:
# Default gate is `high`. Specific examples carry their own
# `audit` value in the matrix when their dep tree has known
# unfixable transitive findings (e.g. bigint-buffer has no
# patched upstream release yet).
AUDIT_LEVEL: ${{ matrix.audit || 'high' }}
run: pnpm audit --prod --audit-level="$AUDIT_LEVEL"