wgpu/.github/workflows/publish.yml

52 lines
1.4 KiB
YAML
Raw Normal View History

2020-04-22 16:00:45 +00:00
name: Publish
on:
2024-01-06 07:58:34 +00:00
pull_request:
paths:
- '.github/workflows/publish.yml'
2020-04-22 16:00:45 +00:00
push:
2023-10-25 20:51:36 +00:00
branches:
- trunk
2020-04-22 16:00:45 +00:00
env:
2023-02-09 15:33:53 +00:00
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
2020-04-22 16:00:45 +00:00
RUSTFLAGS: --cfg=web_sys_unstable_apis
jobs:
2021-12-11 13:47:30 +00:00
publish:
2020-04-22 16:00:45 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
2020-07-23 21:13:04 +00:00
with:
persist-credentials: false
2023-02-09 15:33:53 +00:00
- name: Install Rust WASM target
run: rustup target add wasm32-unknown-unknown
2023-11-05 02:11:34 +00:00
- name: Get wasm-bindgen version
run: |
WASM_BINDGEN_VERSION=$(cargo metadata --format-version 1 --all-features | jq '.packages[] | select(.name == "wasm-bindgen") | .version' | tr -d '"')
echo $WASM_BINDGEN_VERSION
echo "WASM_BINDGEN_VERSION=$WASM_BINDGEN_VERSION" >> "$GITHUB_ENV"
2023-11-05 02:11:34 +00:00
- name: Install wasm-bindgen
run: cargo +stable install wasm-bindgen-cli --version=$WASM_BINDGEN_VERSION
- name: Build examples
run: cargo xtask run-wasm --no-serve
2021-12-11 13:47:30 +00:00
- name: Deploy WebGPU examples
uses: JamesIves/github-pages-deploy-action@v4.5.0
if: github.ref == 'refs/heads/trunk'
2021-12-11 13:47:30 +00:00
with:
2023-02-09 15:33:53 +00:00
token: ${{ secrets.WEB_DEPLOY }}
folder: target/generated
2023-02-09 15:33:53 +00:00
repository-name: gfx-rs/wgpu-rs.github.io
branch: master
target-folder: examples/