1- # Builds the secure-enclave EIF and pushes the carrier image to GHCR.
2- # Pull requests build without publishing.
3- name : Build Enclave EIF Image
1+ # Builds the secure-enclave EIF and validates its PCR generation.
2+ name : Build Enclave EIF
43
54on :
65 pull_request :
1817 tags :
1918 - " v*"
2019 workflow_dispatch :
21- inputs :
22- version :
23- description : " Version tag to publish (including v prefix, e.g. v0.1.0)"
24- required : false
25- type : string
2620
2721permissions :
2822 contents : read
3226
3327jobs :
3428 build-enclave-eif :
35- name : Build enclave EIF + carrier image
29+ name : Build enclave EIF
3630 runs-on : ubuntu-latest
37- permissions :
38- contents : read
39- id-token : write
40- packages : write
41- attestations : write
4231 steps :
4332 - name : Checkout code
4433 uses : actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
4534
35+ - name : Mint biometric-engines access token
36+ id : biometric-engines-token
37+ uses : actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
38+ with :
39+ client-id : ${{ secrets.BIOMETRIC_ENGINES_APP_ID }}
40+ private-key : ${{ secrets.BIOMETRIC_ENGINES_APP_PRIVATE_KEY }}
41+ owner : worldcoin
42+ repositories : biometric-engines
43+
4644 - name : Install Rust toolchain
4745 uses : dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
4846
@@ -52,28 +50,14 @@ jobs:
5250 path : target/eif/aws-nitro-enclaves-cli-${{ env.NITRO_CLI_VERSION }}
5351 key : nitro-cli-${{ runner.os }}-${{ env.NITRO_CLI_VERSION }}
5452
55- - name : Resolve version
56- id : version
57- if : github.ref_type == 'tag' || inputs.version != ''
58- env :
59- INPUT_VERSION : ${{ inputs.version }}
60- run : |
61- if [[ -n "$INPUT_VERSION" ]]; then
62- VERSION="$INPUT_VERSION"
63- else
64- VERSION="$GITHUB_REF_NAME"
65- fi
66- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
67- if [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
68- echo "is_stable=true" >> "$GITHUB_OUTPUT"
69- else
70- echo "is_stable=false" >> "$GITHUB_OUTPUT"
71- fi
72-
7353 - name : Prepare nitro-cli log directory
7454 run : sudo install -d -m 1777 /var/log/nitro_enclaves
7555
7656 - name : Build EIF and PCRs
57+ env :
58+ GIT_HUB_TOKEN : ${{ steps.biometric-engines-token.outputs.token }}
59+ # TODO: Remove when models are injected into the enclave at runtime.
60+ SKIP_MODEL_DOWNLOAD : " true"
7761 run : scripts/build-eif.sh target/eif
7862
7963 - name : Publish PCR measurements
9175 name : enclave-pcrs
9276 path : target/eif/pcrs.json
9377 if-no-files-found : error
94-
95- - name : Docker meta
96- id : meta
97- uses : docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
98- with :
99- images : ghcr.io/${{ github.repository }}-enclave-eif
100- tags : |
101- type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || steps.version.outputs.is_stable == 'true' }}
102- type=sha
103- type=raw,value=${{ steps.version.outputs.version }},enable=${{ steps.version.outputs.version != '' }}
104-
105- - name : Set up Docker Buildx
106- uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
107-
108- - name : Login to GitHub Container Registry
109- if : github.event_name != 'pull_request'
110- uses : docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
111- with :
112- registry : ghcr.io
113- username : ${{ github.actor }}
114- password : ${{ secrets.GITHUB_TOKEN }}
115-
116- - name : Build and push carrier image
117- id : build
118- uses : docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
119- with :
120- # Context is the EIF output dir so the .eif is always included.
121- context : target/eif
122- file : secure-enclave/Dockerfile.eif
123- push : ${{ github.event_name != 'pull_request' }}
124- tags : ${{ steps.meta.outputs.tags }}
125- labels : ${{ steps.meta.outputs.labels }}
126- platforms : linux/amd64
127-
128- - name : Attest build provenance
129- if : github.event_name != 'pull_request'
130- uses : actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1
131- with :
132- push-to-registry : true
133- subject-name : ghcr.io/${{ github.repository }}-enclave-eif
134- subject-digest : ${{ steps.build.outputs.digest }}
0 commit comments