Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion .github/workflows/canister-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,46 @@
# 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:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-latest
needs: docker-build-ii
Expand Down Expand Up @@ -722,7 +762,13 @@
# 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
Expand Down Expand Up @@ -751,6 +797,12 @@
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:
Expand Down Expand Up @@ -816,6 +868,7 @@
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
Expand Down Expand Up @@ -843,6 +896,7 @@
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
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Loading