mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 08:44:08 +00:00
69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
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
|
|
|
|
- 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
|