mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- gecko
|
|
|
|
env:
|
|
RUSTFLAGS: --cfg=web_sys_unstable_apis
|
|
|
|
jobs:
|
|
build:
|
|
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: Build the examples
|
|
run: cargo build --release --target wasm32-unknown-unknown --examples
|
|
|
|
- name: Install wasm-bindgen-cli
|
|
run: cargo install wasm-bindgen-cli
|
|
|
|
- name: Generate JS bindings for the examples
|
|
run: |
|
|
for i in target/wasm32-unknown-unknown/release/examples/*.wasm;
|
|
do
|
|
wasm-bindgen --no-typescript --out-dir target/generated --web "$i";
|
|
done
|
|
|
|
- name: Deploy the examples
|
|
uses: JamesIves/github-pages-deploy-action@releases/v3
|
|
with:
|
|
ACCESS_TOKEN: ${{ secrets.WEB_DEPLOY }}
|
|
FOLDER: target/generated
|
|
REPOSITORY_NAME: gfx-rs/wgpu-rs.github.io
|
|
BRANCH: master
|
|
TARGET_FOLDER: examples/wasm
|