Skip to content

Commit 133b995

Browse files
committed
Address PR revie comments
1 parent fc4bcfe commit 133b995

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

scripts/build

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -xeuo pipefail
3+
set -euo pipefail
44

55
# Make sure we always run from the root
66
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -84,14 +84,14 @@ if [ ${#CANISTERS[@]} -eq 0 ]; then
8484
CANISTERS=("internet_identity")
8585
fi
8686

87-
# # Checking for dependencies
88-
# if [[ ! "$(command -v ic-wasm)" || "$(ic-wasm --version)" != "ic-wasm 0.8.5" ]]
89-
# then
90-
# echo "could not find ic-wasm 0.8.5"
91-
# echo "ic-wasm version 0.8.5 is needed, please run the following command:"
92-
# echo " cargo install ic-wasm --version 0.8.5"
93-
# exit 1
94-
# fi
87+
# Checking for dependencies
88+
if [[ ! "$(command -v ic-wasm)" || "$(ic-wasm --version)" != "ic-wasm 0.8.5" ]]
89+
then
90+
echo "could not find ic-wasm 0.8.5"
91+
echo "ic-wasm version 0.8.5 is needed, please run the following command:"
92+
echo " cargo install ic-wasm --version 0.8.5"
93+
exit 1
94+
fi
9595

9696
# Check for exact node version
9797
if [[ "$(node --version)" != "v$(cat .node-version)" ]]

scripts/make-upgrade-proposal

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,16 @@ wait_for_archive_canister_hash() {
304304
download_wasms() {
305305
local upgrade_type="$(checklist_must_get 'Upgrade type')"
306306
if should_upgrade_backend "$upgrade_type"; then
307-
curl -sSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_production.wasm.gz -o internet_identity.wasm.gz
308-
curl -sSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/archive.wasm.gz -o archive.wasm.gz
307+
curl -fsSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_production.wasm.gz -o internet_identity.wasm.gz
308+
curl -fsSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/archive.wasm.gz -o archive.wasm.gz
309+
gzip -t internet_identity.wasm.gz || { echo "ERROR: internet_identity.wasm.gz is not a valid gzip file"; exit 1; }
310+
gzip -t archive.wasm.gz || { echo "ERROR: archive.wasm.gz is not a valid gzip file"; exit 1; }
309311
fi
310312
if should_upgrade_frontend "$upgrade_type"; then
311313
# NOTE: The CI workflow must publish internet_identity_frontend.wasm.gz to GitHub releases
312314
# If this download fails, ensure the release workflow includes the frontend WASM artifact
313-
curl -sSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_frontend.wasm.gz -o internet_identity_frontend.wasm.gz
315+
curl -fsSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_frontend.wasm.gz -o internet_identity_frontend.wasm.gz
316+
gzip -t internet_identity_frontend.wasm.gz || { echo "ERROR: internet_identity_frontend.wasm.gz is not a valid gzip file"; exit 1; }
314317
fi
315318
}
316319

@@ -326,7 +329,7 @@ request_verification_command() {
326329

327330
if should_upgrade_frontend "$upgrade_type"; then
328331
FRONTEND_WASM_SHA=$(sha256sum "internet_identity_frontend.wasm.gz" | awk '{print $1}')
329-
cmd_parts+=("--frontend-hash $FRONTEND_WASM_SHA")
332+
cmd_parts+=("--iife-hash $FRONTEND_WASM_SHA")
330333
fi
331334

332335
echo "Run the following command in another terminal to verify the hashes"
@@ -605,7 +608,7 @@ dry_run_proposal() {
605608
if should_upgrade_backend "$upgrade_type"; then
606609
echo "=== Dry run for Backend Proposal ==="
607610
# Download again the release tag wasm to check the hash along the latest downloaded before.
608-
curl -sSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_production.wasm.gz -o internet_identity-$TAG_NAME.wasm.gz
611+
curl -fsSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_production.wasm.gz -o internet_identity-$TAG_NAME.wasm.gz
609612
# Read again the arguments to check the hash along the mainnet_arg.bin file sent in the proposal.
610613
ic-admin \
611614
--use-hsm \
@@ -628,7 +631,7 @@ dry_run_proposal() {
628631

629632
if should_upgrade_frontend "$upgrade_type"; then
630633
echo "=== Dry run for Frontend Proposal ==="
631-
curl -sSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_frontend.wasm.gz -o internet_identity_frontend-$TAG_NAME.wasm.gz
634+
curl -fsSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_frontend.wasm.gz -o internet_identity_frontend-$TAG_NAME.wasm.gz
632635
ic-admin \
633636
--use-hsm \
634637
--key-id "01" \
@@ -655,7 +658,7 @@ make_proposal() {
655658
if should_upgrade_backend "$upgrade_type"; then
656659
echo "=== Creating Backend Proposal ==="
657660
# Download again the release tag wasm to check the hash along the latest downloaded before.
658-
curl -sSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_production.wasm.gz -o internet_identity-$TAG_NAME.wasm.gz
661+
curl -fsSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_production.wasm.gz -o internet_identity-$TAG_NAME.wasm.gz
659662
# Read again the arguments to check the hash along the mainnet_arg.bin file sent in the proposal.
660663
ic-admin \
661664
--use-hsm \
@@ -677,7 +680,7 @@ make_proposal() {
677680

678681
if should_upgrade_frontend "$upgrade_type"; then
679682
echo "=== Creating Frontend Proposal ==="
680-
curl -sSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_frontend.wasm.gz -o internet_identity_frontend-$TAG_NAME.wasm.gz
683+
curl -fsSL https://github.com/dfinity/internet-identity/releases/download/$TAG_NAME/internet_identity_frontend.wasm.gz -o internet_identity_frontend-$TAG_NAME.wasm.gz
681684
ic-admin \
682685
--use-hsm \
683686
--key-id "01" \

0 commit comments

Comments
 (0)