@@ -394,3 +394,100 @@ jobs:
394394 TARGET_BASE_IMAGE=alpine:3.22
395395 TARGETOS=linux
396396 TARGETARCH=amd64
397+
398+ build-op-batcher-tee :
399+ runs-on : ubuntu-latest
400+ permissions :
401+ contents : read
402+ packages : write
403+ env :
404+ ENCLAVE_APP_IMAGE : op-batcher-enclave:app
405+ steps :
406+ - name : Checkout
407+ uses : actions/checkout@v4
408+
409+ - name : Install just
410+ uses : extractions/setup-just@v2
411+
412+ - name : Install Rust
413+ uses : actions-rs/toolchain@v1
414+ with :
415+ toolchain : stable
416+ override : true
417+
418+ - name : Install Foundry
419+ uses : foundry-rs/foundry-toolchain@v1
420+ with :
421+ version : nightly
422+
423+ - name : Install dasel
424+ run : |
425+ curl -sSL "https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64" -o /tmp/dasel
426+ sudo mv /tmp/dasel /usr/local/bin/dasel
427+ sudo chmod +x /usr/local/bin/dasel
428+ dasel --version
429+
430+ - name : Check for package.json
431+ id : check-package
432+ run : |
433+ if [ -f "package.json" ]; then
434+ echo "has-package=true" >> $GITHUB_OUTPUT
435+ else
436+ echo "has-package=false" >> $GITHUB_OUTPUT
437+ fi
438+
439+ - name : Setup Node.js
440+ if : steps.check-package.outputs.has-package == 'true'
441+ uses : actions/setup-node@v4
442+ with :
443+ node-version : ' 18'
444+ cache : ' npm'
445+
446+ - name : Run Enclaver installation
447+ run : |
448+ echo "Downloading and installing Enclaver..."
449+ ARCH=$(uname -m)
450+ LATEST_RELEASE=$(curl -s https://api.github.com/repositories/516492075/releases/latest)
451+ DOWNLOAD_URL=$(echo "$LATEST_RELEASE" | jq -r ".assets[] | select(.name | test(\"^enclaver-linux-$ARCH.*tar.gz$\")) | .browser_download_url")
452+ if [ -z "$DOWNLOAD_URL" ]; then
453+ echo "Could not find Enclaver download URL"
454+ exit 1
455+ fi
456+ curl -L "$DOWNLOAD_URL" -o enclaver.tar.gz
457+ tar xzf enclaver.tar.gz
458+ sudo install enclaver-*/enclaver /usr/local/bin/
459+ rm -rf enclaver.tar.gz enclaver-*
460+ enclaver --version
461+
462+ - name : Install dependencies
463+ if : steps.check-package.outputs.has-package == 'true'
464+ run : npm ci
465+
466+ - name : Build op-batcher enclave image
467+ run : |
468+ cd espresso
469+ ./scripts/batcher-enclave-image.sh
470+
471+ - name : Login to GitHub Container Registry
472+ uses : docker/login-action@v3
473+ with :
474+ registry : ${{ env.REGISTRY }}
475+ username : ${{ github.actor }}
476+ password : ${{ secrets.GITHUB_TOKEN }}
477+
478+ - name : Extract metadata
479+ id : meta
480+ uses : docker/metadata-action@v5
481+ with :
482+ images : ${{ env.IMAGE_PREFIX }}/op-batcher-tee
483+ tags : |
484+ type=ref,event=branch
485+ type=ref,event=pr
486+ type=sha,prefix={{branch}}-,enable={{is_default_branch}}
487+ type=raw,value=latest,enable={{is_default_branch}}
488+ type=raw,value=pr-${{ github.event.number }},enable=${{ github.event_name == 'pull_request' }}
489+
490+ - name : Tag and push op-batcher-tee image
491+ run : |
492+ docker tag "${{ env.ENCLAVE_APP_IMAGE }}" ${{ steps.meta.outputs.tags }}
493+ docker push ${{ steps.meta.outputs.tags }}
0 commit comments