forked from gfx-rs/wgpu
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.95 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
name: Publish
on:
push:
branches:
- gecko
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Rust WASM toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Install wasm-bindgen-cli
run: cargo install wasm-bindgen-cli --version=0.2.81
- name: Build WebGPU examples
run: cargo build --release --target wasm32-unknown-unknown --examples
- name: Generate JS bindings for WebGPU examples
run: |
for i in target/wasm32-unknown-unknown/release/examples/*.wasm;
do
wasm-bindgen --no-typescript --out-dir target/generated-gpu --web "$i";
done
- name: Deploy WebGPU examples
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_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 --examples --features webgl
- name: Generate JS bindings for WebGL examples
run: |
for i in target/wasm32-unknown-unknown/release/examples/*.wasm;
do
wasm-bindgen --no-typescript --out-dir target/generated-gl --web "$i";
done
- name: Deploy WebGL examples
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.WEB_DEPLOY }}
FOLDER: target/generated-gl
REPOSITORY_NAME: gfx-rs/wgpu-rs.github.io
BRANCH: master
TARGET_FOLDER: examples-gl/wasm