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
|
2024-03-01 21:13:14 +00:00
|
|
|
RUSTFLAGS:
|
2020-04-22 16:00:45 +00:00
|
|
|
|
|
|
|
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
|
2023-09-05 13:27:38 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-07-23 21:13:04 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2020-06-23 01:53:50 +00:00
|
|
|
|
2023-02-09 15:33:53 +00:00
|
|
|
- name: Install Rust WASM target
|
|
|
|
run: rustup target add wasm32-unknown-unknown
|
2020-06-23 01:53:50 +00:00
|
|
|
|
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-06-10 22:29:16 +00:00
|
|
|
|
2023-11-05 02:11:34 +00:00
|
|
|
- name: Install wasm-bindgen
|
|
|
|
run: cargo +stable install wasm-bindgen-cli --version=$WASM_BINDGEN_VERSION
|
2020-06-23 01:53:50 +00:00
|
|
|
|
2023-11-25 22:20:11 +00:00
|
|
|
- name: Build examples
|
|
|
|
run: cargo xtask run-wasm --no-serve
|
2021-12-11 13:47:30 +00:00
|
|
|
|
|
|
|
- name: Deploy WebGPU examples
|
2024-11-11 09:06:36 +00:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.6.9
|
2023-06-10 22:29:16 +00:00
|
|
|
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 }}
|
2023-11-25 22:20:11 +00:00
|
|
|
folder: target/generated
|
2023-02-09 15:33:53 +00:00
|
|
|
repository-name: gfx-rs/wgpu-rs.github.io
|
|
|
|
branch: master
|
2023-11-25 22:20:11 +00:00
|
|
|
target-folder: examples/
|