-
Notifications
You must be signed in to change notification settings - Fork 952
74 lines (61 loc) · 2.11 KB
/
publish.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Publish
on:
push:
branches: ["*"]
pull_request:
merge_group:
env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: --cfg=web_sys_unstable_apis
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Rust WASM target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-bindgen-cli
run: cargo +stable install wasm-bindgen-cli --version=0.2.87
- name: Pin wasm-bindgen version
run: cargo update -p wasm-bindgen --precise 0.2.87
- name: Build WebGPU examples
run: cargo build --release --target wasm32-unknown-unknown
- name: Generate JS bindings for WebGPU examples
run: |
for i in target/wasm32-unknown-unknown/release/*.wasm;
do
wasm-bindgen --no-typescript --out-dir target/generated-gpu --web "$i";
done
- name: Deploy WebGPU examples
uses: JamesIves/github-pages-deploy-action@v4.4.3
if: github.ref == 'refs/heads/trunk'
with:
token: ${{ secrets.WEB_DEPLOY }}
folder: target/generated-gpu
repository-name: gfx-rs/wgpu-rs.github.io
branch: master
target-folder: examples-gpu/wasm
- name: Clean the build
run: cargo clean
- name: Build WebGL examples
run: cargo build --release --target wasm32-unknown-unknown --features webgl
- name: Generate JS bindings for WebGL examples
run: |
for i in target/wasm32-unknown-unknown/release/*.wasm;
do
wasm-bindgen --no-typescript --out-dir target/generated-gl --web "$i";
done
- name: Deploy WebGL examples
uses: JamesIves/github-pages-deploy-action@v4.4.3
if: github.ref == 'refs/heads/trunk'
with:
token: ${{ secrets.WEB_DEPLOY }}
folder: target/generated-gl
repository-name: gfx-rs/wgpu-rs.github.io
branch: master
target-folder: examples-gl/wasm