Skip to content

Commit 3380aca

Browse files
authored
chore: Publish internet_identity_frontend.wasm.gz in CI (#3646)
This PR configures GitHub to publish internet_identity_frontend.wasm.gz in CI pipelines.
1 parent fb2f215 commit 3380aca

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

.github/workflows/canister-tests.yml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,46 @@ jobs:
137137
# downloaded file
138138
path: archive.wasm.gz
139139

140+
docker-build-internet_identity_frontend:
141+
runs-on: ubuntu-latest
142+
needs: docker-build-base
143+
steps:
144+
- uses: actions/checkout@v4
145+
146+
- name: Infer version
147+
id: version
148+
run: |
149+
version="$(./scripts/version)"
150+
echo "Inferred version: '$version'"
151+
echo "version=$version" >> "$GITHUB_OUTPUT"
152+
153+
- name: Set up docker buildx
154+
uses: docker/setup-buildx-action@v3
155+
156+
- name: Build internet_identity_frontend.wasm.gz
157+
uses: docker/build-push-action@v5
158+
with:
159+
context: .
160+
file: Dockerfile
161+
build-args: |
162+
II_VERSION=${{ steps.version.outputs.version }}
163+
II_DEV_CSP=0
164+
cache-from: type=gha,scope=cached-stage
165+
# Exports the artefacts from the final stage
166+
outputs: ./out
167+
target: scratch_internet_identity_frontend
168+
169+
- run: mv out/internet_identity_frontend.wasm.gz internet_identity_frontend.wasm.gz
170+
- run: sha256sum internet_identity_frontend.wasm.gz
171+
- name: "Upload internet_identity_frontend.wasm.gz"
172+
uses: actions/upload-artifact@v4
173+
with:
174+
# name is the name used to display and retrieve the artifact
175+
name: internet_identity_frontend.wasm.gz
176+
# path is the name used as the file to upload and the name of the
177+
# downloaded file
178+
path: internet_identity_frontend.wasm.gz
179+
140180
wasm-size:
141181
runs-on: ubuntu-latest
142182
needs: docker-build-ii
@@ -722,7 +762,13 @@ jobs:
722762
# On release tags, a new release is created and the assets are uploaded.
723763
release:
724764
runs-on: ubuntu-latest
725-
needs: [docker-build-ii, docker-build-archive, vc_demo_issuer-build]
765+
needs:
766+
[
767+
docker-build-ii,
768+
docker-build-archive,
769+
docker-build-internet_identity_frontend,
770+
vc_demo_issuer-build,
771+
]
726772

727773
steps:
728774
- uses: actions/checkout@v4
@@ -751,6 +797,12 @@ jobs:
751797
name: archive.wasm.gz
752798
path: .
753799

800+
- name: "Download frontend"
801+
uses: actions/download-artifact@v4
802+
with:
803+
name: internet_identity_frontend.wasm.gz
804+
path: .
805+
754806
- name: "Download issuer"
755807
uses: actions/download-artifact@v4
756808
with:
@@ -816,6 +868,7 @@ jobs:
816868
internet_identity_production.wasm.gz
817869
internet_identity_dev.wasm.gz
818870
internet_identity_test.wasm.gz
871+
internet_identity_frontend.wasm.gz
819872
archive.wasm.gz
820873
vc_demo_issuer.wasm.gz
821874
production_asset: internet_identity_production.wasm.gz
@@ -843,6 +896,7 @@ jobs:
843896
internet_identity_production.wasm.gz.sha256 \
844897
internet_identity_dev.wasm.gz \
845898
internet_identity_test.wasm.gz \
899+
internet_identity_frontend.wasm.gz \
846900
src/internet_identity/internet_identity.did \
847901
archive.wasm.gz \
848902
vc_demo_issuer.wasm.gz

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,27 @@ RUN touch src/*/src/lib.rs
9999
RUN ./scripts/build --archive
100100
RUN sha256sum /archive.wasm.gz
101101

102+
FROM deps as build_internet_identity_frontend
103+
104+
COPY . .
105+
106+
# The version baked in
107+
ARG II_VERSION=
108+
109+
# The features, see README
110+
ARG II_DEV_CSP=
111+
112+
RUN touch src/*/src/lib.rs
113+
RUN npm ci
114+
115+
RUN ./scripts/build --frontend
116+
RUN sha256sum /internet_identity_frontend.wasm.gz
117+
102118
FROM scratch AS scratch_internet_identity
103119
COPY --from=build_internet_identity /internet_identity.wasm.gz /
104120

105121
FROM scratch AS scratch_archive
106122
COPY --from=build_archive /archive.wasm.gz /
123+
124+
FROM scratch AS scratch_internet_identity_frontend
125+
COPY --from=build_internet_identity_frontend /internet_identity_frontend.wasm.gz /

0 commit comments

Comments
 (0)