diff --git a/.github/workflows/canister-tests.yml b/.github/workflows/canister-tests.yml index f1e4aad8f3..8b92bbd748 100644 --- a/.github/workflows/canister-tests.yml +++ b/.github/workflows/canister-tests.yml @@ -137,6 +137,46 @@ jobs: # downloaded file path: archive.wasm.gz + docker-build-internet_identity_frontend: + runs-on: ubuntu-latest + needs: docker-build-base + steps: + - uses: actions/checkout@v4 + + - name: Infer version + id: version + run: | + version="$(./scripts/version)" + echo "Inferred version: '$version'" + echo "version=$version" >> "$GITHUB_OUTPUT" + + - name: Set up docker buildx + uses: docker/setup-buildx-action@v3 + + - name: Build internet_identity_frontend.wasm.gz + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + build-args: | + II_VERSION=${{ steps.version.outputs.version }} + II_DEV_CSP=0 + cache-from: type=gha,scope=cached-stage + # Exports the artefacts from the final stage + outputs: ./out + target: scratch_internet_identity_frontend + + - run: mv out/internet_identity_frontend.wasm.gz internet_identity_frontend.wasm.gz + - run: sha256sum internet_identity_frontend.wasm.gz + - name: "Upload internet_identity_frontend.wasm.gz" + uses: actions/upload-artifact@v4 + with: + # name is the name used to display and retrieve the artifact + name: internet_identity_frontend.wasm.gz + # path is the name used as the file to upload and the name of the + # downloaded file + path: internet_identity_frontend.wasm.gz + wasm-size: runs-on: ubuntu-latest needs: docker-build-ii @@ -722,7 +762,13 @@ jobs: # On release tags, a new release is created and the assets are uploaded. release: runs-on: ubuntu-latest - needs: [docker-build-ii, docker-build-archive, vc_demo_issuer-build] + needs: + [ + docker-build-ii, + docker-build-archive, + docker-build-internet_identity_frontend, + vc_demo_issuer-build, + ] steps: - uses: actions/checkout@v4 @@ -751,6 +797,12 @@ jobs: name: archive.wasm.gz path: . + - name: "Download frontend" + uses: actions/download-artifact@v4 + with: + name: internet_identity_frontend.wasm.gz + path: . + - name: "Download issuer" uses: actions/download-artifact@v4 with: @@ -816,6 +868,7 @@ jobs: internet_identity_production.wasm.gz internet_identity_dev.wasm.gz internet_identity_test.wasm.gz + internet_identity_frontend.wasm.gz archive.wasm.gz vc_demo_issuer.wasm.gz production_asset: internet_identity_production.wasm.gz @@ -843,6 +896,7 @@ jobs: internet_identity_production.wasm.gz.sha256 \ internet_identity_dev.wasm.gz \ internet_identity_test.wasm.gz \ + internet_identity_frontend.wasm.gz \ src/internet_identity/internet_identity.did \ archive.wasm.gz \ vc_demo_issuer.wasm.gz diff --git a/Dockerfile b/Dockerfile index fd97b904c1..3ca50b6889 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,8 +99,27 @@ RUN touch src/*/src/lib.rs RUN ./scripts/build --archive RUN sha256sum /archive.wasm.gz +FROM deps as build_internet_identity_frontend + +COPY . . + +# The version baked in +ARG II_VERSION= + +# The features, see README +ARG II_DEV_CSP= + +RUN touch src/*/src/lib.rs +RUN npm ci + +RUN ./scripts/build --frontend +RUN sha256sum /internet_identity_frontend.wasm.gz + FROM scratch AS scratch_internet_identity COPY --from=build_internet_identity /internet_identity.wasm.gz / FROM scratch AS scratch_archive COPY --from=build_archive /archive.wasm.gz / + +FROM scratch AS scratch_internet_identity_frontend +COPY --from=build_internet_identity_frontend /internet_identity_frontend.wasm.gz /