mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
[rs] Build and deploy examples in CI
This commit is contained in:
parent
94c06b0c9b
commit
31726862c9
39
.github/workflows/publish.yml
vendored
Normal file
39
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
RUSTFLAGS: --cfg=web_sys_unstable_apis
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v2
|
||||
- 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 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||
with:
|
||||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
FOLDER: target/generated
|
||||
TARGET_FOLDER: examples
|
||||
Loading…
x
Reference in New Issue
Block a user