This repository was archived by the owner on Sep 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (46 loc) · 1.79 KB
/
wasm_gallery.yaml
File metadata and controls
49 lines (46 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: MIT
name: Build a WASM version of the gallery example
on:
workflow_dispatch:
workflow_call:
jobs:
wasm_build:
env:
CARGO_PROFILE_RELEASE_OPT_LEVEL: s
CARGO_INCREMENTAL: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache WASM build
id: cache-wasm
uses: actions/cache@v4
with:
path: |
examples/gallery/pkg
examples/gallery/index.html
examples/gallery/frame-tablet.webp
key: wasm-build-${{ hashFiles('examples/gallery/**', 'ui/**', 'Cargo.toml', 'material.slint', 'crate/**') }}
- name: Install Rust
if: steps.cache-wasm.outputs.cache-hit != 'true'
uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
- name: Install wasm-pack
if: steps.cache-wasm.outputs.cache-hit != 'true'
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- uses: Swatinem/rust-cache@v2
if: steps.cache-wasm.outputs.cache-hit != 'true'
with:
key: wasm-build
- name: Build
if: steps.cache-wasm.outputs.cache-hit != 'true'
working-directory: examples/gallery
run: wasm-pack build --target web
- name: "Upload Artifacts"
uses: actions/upload-artifact@v4
with:
name: wasm_gallery
path: |
examples/gallery/frame-tablet.webp
examples/gallery/pkg