1- name : Demo Sandbox
1+ name : _Demo Deploy
22
33on :
44 workflow_call :
55
6+ # Los permisos efectivos los otorga pipeline.yml en el job "demo".
7+ # Se declaran aquí también para documentar qué necesita este workflow.
68permissions :
79 contents : read
810 pages : write
@@ -14,82 +16,39 @@ concurrency:
1416
1517jobs :
1618 deploy :
19+ name : GitHub Pages
1720 environment :
1821 name : github-pages
1922 url : ${{ steps.deployment.outputs.page_url }}
2023 runs-on : ubuntu-latest
24+
2125 steps :
22- - uses : actions/checkout@v5
26+ - uses : actions/checkout@v4
2327
24- - name : Cache Rust
25- uses : Swatinem/rust-cache@v2
28+ # Download the .wasm already compiled and optimized by _wasm.yml.
29+ - name : Download wasm artifact
30+ uses : actions/download-artifact@v4
2631 with :
27- workspaces : compiler
28-
29- - uses : dtolnay/rust-toolchain@stable
30-
31- - name : Install wasm target
32- run : rustup target add wasm32-unknown-unknown
33- working-directory : compiler
34-
35- - name : Install wasm-opt
36- run : |
37- curl -sSL https://github.com/WebAssembly/binaryen/releases/download/version_121/binaryen-version_121-x86_64-linux.tar.gz \
38- | tar -xz --strip-components=2 -C /usr/local/bin binaryen-version_121/bin/wasm-opt
39- wasm-opt --version
40-
41- - name : Build wasm
42- run : cargo build --target wasm32-unknown-unknown --features wasm --lib --release
43- working-directory : compiler
44-
45- - name : Size (unoptimized)
46- run : ls -lh target/wasm32-unknown-unknown/release/compiler_lib.wasm
47- working-directory : compiler
48-
49- - name : Optimize wasm
50- run : |
51- INPUT=compiler/target/wasm32-unknown-unknown/release/compiler_lib.wasm
52-
53- wasm-opt -Oz --converge \
54- --generate-global-effects \
55- --strip-debug --strip-producers \
56- --enable-bulk-memory-opt \
57- --enable-nontrapping-float-to-int \
58- --enable-sign-ext \
59- -tnh \
60- -o /tmp/wasm_stage1.wasm "$INPUT"
61-
62- wasm-opt --flatten --rereloop -Oz -Oz \
63- --enable-bulk-memory-opt \
64- --enable-nontrapping-float-to-int \
65- --enable-sign-ext \
66- -o "$INPUT" /tmp/wasm_stage1.wasm
67-
68- rm /tmp/wasm_stage1.wasm
32+ name : compiler_lib_wasm
33+ path : demo/
6934
7035 - name : Write version manifest
7136 run : |
72- HASH=$(sha256sum compiler/target/wasm32-unknown-unknown/release/compiler_lib.wasm \
73- | cut -c1-12)
37+ HASH=$(sha256sum demo/compiler_lib.wasm | cut -c1-12)
7438 printf '{"v":"%s"}\n' "$HASH" > demo/version.json
7539
76- - name : Size (optimized)
77- run : ls -lh target/wasm32-unknown-unknown/release/compiler_lib.wasm
78- working-directory : compiler
79-
80- - name : Stage wasm
81- run : cp compiler/target/wasm32-unknown-unknown/release/compiler_lib.wasm demo/
82-
8340 - name : Build Tailwind CSS
8441 working-directory : demo
85- run : echo "@tailwind base;@tailwind components;@tailwind utilities;" | npx tailwindcss@3 --input - --output tailwind.css --minify
42+ run : |
43+ echo "@tailwind base;@tailwind components;@tailwind utilities;" \
44+ | npx tailwindcss@3 --input - --output tailwind.css --minify
8645
8746 - name : Setup Pages
88- uses : actions/configure-pages@v5
47+ uses : actions/configure-pages@v4
8948 with :
9049 enablement : true
9150
92- - name : Upload artifact
51+ - name : Upload Pages artifact
9352 uses : actions/upload-pages-artifact@v3
9453 with :
9554 path : demo
0 commit comments