Skip to content

Commit bc937eb

Browse files
committed
allow skipping Wasm build by SKIP_WASM_BUILD environment variable on deploying playground
1 parent 21e3529 commit bc937eb

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ npm run serve
143143
git push
144144
```
145145

146+
Note: `SKIP_BUILD_WASM` environment variable can skip building `main.wasm` binary. Please set it when the Wasm binary
147+
doesn't need to be updated. It is important to avoid bloating a repository size by including a big Wasm binary in a
148+
commit.
149+
150+
```sh
151+
SKIP_BUILD_WASM=true bash ./playground/deploy.bash
152+
```
153+
146154
## Maintain auto-generated sources
147155

148156
Some files are generated by scripts in [`scripts/`](./scripts) directory. These files are kept up-to-date by CI workflows.

playground/deploy.bash

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,26 @@ files=(
3030
style.css
3131
)
3232

33-
echo 'Copying built assets from ./playground to ./playground-dist'
33+
if [[ "$SKIP_BUILD_WASM" != "" ]]; then
34+
files=("${files[@]/main.wasm}")
35+
fi
36+
37+
echo "Copying built assets from ./playground to ./playground-dist: " "${files[@]}"
3438
for f in "${files[@]}"; do
3539
cp -R "./playground/${f}" "./playground-dist/${f}"
3640
done
3741

38-
echo 'Applying wasm-opt to ./playground-dist/main.wasm'
39-
wasm-opt -O -o ./playground-dist/opt.wasm ./playground-dist/main.wasm --enable-bulk-memory
40-
mv ./playground-dist/opt.wasm ./playground-dist/main.wasm
42+
if [[ "$SKIP_BUILD_WASM" == "" ]]; then
43+
echo 'Applying wasm-opt to ./playground-dist/main.wasm'
44+
wasm-opt -O -o ./playground-dist/opt.wasm ./playground-dist/main.wasm --enable-bulk-memory
45+
mv ./playground-dist/opt.wasm ./playground-dist/main.wasm
46+
else
47+
echo 'Skipped applying wasm-opt because SKIP_BUILD_WASM environment variable is set'
48+
fi
4149

4250
echo 'Generating and copying manual'
4351
make ./man/actionlint.1.html
44-
cp ./man/actionlint.1.html ./playground-dist/usage.html
52+
cp ./man/actionlint.1.html ./playground-dist/man.html
4553

4654
echo 'Switching to gh-pages branch'
4755
git checkout gh-pages
@@ -59,8 +67,8 @@ for f in "${files[@]}"; do
5967
done
6068

6169
echo 'Adding manual'
62-
cp ./playground-dist/usage.html ./usage.html
63-
git add ./usage.html
70+
cp ./playground-dist/man.html ./man.html
71+
git add ./man.html
6472

6573
echo 'Making commit for new deploy'
6674
git commit -m "deploy from ${sha}"

0 commit comments

Comments
 (0)