Repository navigation
feat(android): v1.8.2 — multi-touch virtual controller + app icon #319
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Pages (demo + docs) | |
| # Builds the wasm32 frontend with trunk AND the workspace rustdoc, then | |
| # publishes BOTH to GitHub Pages in a single deployment | |
| # (https://doublegate.github.io/RustyNES/): | |
| # | |
| # / the playable wasm demo (the full winit + wgpu + egui build) | |
| # /api/ the workspace API documentation (rustdoc) | |
| # | |
| # GitHub Pages allows only one deployment source per repo, so the demo and | |
| # the docs are assembled into one artifact and deployed together (the Pages | |
| # source must be "GitHub Actions", build_type: workflow — NOT a branch). This | |
| # replaces the legacy gh-pages-branch docs deploy. | |
| # | |
| # Two jobs: `build` produces + size-gates the demo, builds the docs, assembles | |
| # the combined `_site/`, and uploads it as a Pages artifact; `deploy` publishes | |
| # it. The build also runs on pull requests (deploy does NOT) so the size budget | |
| # gates PRs without publishing a preview. | |
| # | |
| # trunk auto-downloads the wasm-bindgen CLI + wasm-opt versions pinned in | |
| # crates/rustynes-frontend/web/Trunk.toml. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "crates/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - ".cargo/config.toml" | |
| - "rust-toolchain.toml" | |
| - "scripts/wasm_size_budget.sh" | |
| - ".github/workflows/web.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "crates/**" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - ".cargo/config.toml" | |
| - "rust-toolchain.toml" | |
| - "scripts/wasm_size_budget.sh" | |
| - ".github/workflows/web.yml" | |
| workflow_dispatch: | |
| # Pages deploy needs these; everything else is read-only. | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Only one Pages deploy at a time; let an in-flight one finish rather | |
| # than cancelling (a half-applied Pages deploy is worse than a slow one). | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Pin trunk for reproducible builds. Bump deliberately; keep in sync | |
| # with the local toolchain note in Trunk.toml. | |
| TRUNK_VERSION: "0.21.14" | |
| # Repository ("project") Pages serve under /<repo>/, so every asset | |
| # URL trunk emits must be prefixed. Overrides Trunk.toml's local "/" | |
| # without editing it (local `trunk serve` stays root-mounted). | |
| PUBLIC_URL: "/RustyNES/" | |
| jobs: | |
| build: | |
| name: build demo + docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # Shared toolchain + cargo cache. `apt: true` because the rustdoc build | |
| # compiles the whole workspace (incl. rustynes-frontend) for the host, | |
| # which needs the native winit/wgpu/cpal system libraries. The wasm build | |
| # itself routes through web-sys and would not need them, but the doc build | |
| # in the same job does. | |
| - uses: ./.github/actions/rust-setup | |
| with: | |
| targets: wasm32-unknown-unknown | |
| apt: "true" | |
| cache-key: web-pages | |
| - name: Install trunk (prebuilt release binary) | |
| run: | | |
| curl -fsSL \ | |
| "https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" \ | |
| | tar -xz -C /usr/local/bin trunk | |
| trunk --version | |
| - name: Build the wasm demo (release) for GitHub Pages | |
| working-directory: crates/rustynes-frontend/web | |
| run: trunk build --release --public-url "${PUBLIC_URL}" | |
| - name: Enforce wasm size budget (< 5 MiB gzip) | |
| run: ./scripts/wasm_size_budget.sh crates/rustynes-frontend/web/dist 5242880 | |
| - name: Build the workspace API docs (rustdoc) | |
| # --no-deps keeps it to our own crates. No -D warnings here: the lint | |
| # job in ci.yml already gates rustdoc, so the Pages build only needs the | |
| # HTML and must not fail the deploy on a doc nit. | |
| run: cargo doc --workspace --no-deps | |
| - name: Assemble the Pages site (demo at /, rustdoc at /api/) | |
| run: | | |
| set -euo pipefail | |
| rm -rf _site | |
| mkdir -p _site/api | |
| cp -r crates/rustynes-frontend/web/dist/. _site/ | |
| cp -r target/doc/. _site/api/ | |
| # rustdoc emits no root index for a multi-crate workspace; add a | |
| # redirect to the main library facade so /api/ lands somewhere useful. | |
| cat > _site/api/index.html <<'HTML' | |
| <!doctype html> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="refresh" content="0; url=rustynes_core/index.html"> | |
| <title>RustyNES API documentation</title> | |
| <a href="rustynes_core/index.html">RustyNES API documentation</a> | |
| HTML | |
| - name: Configure Pages | |
| # build_type is set to "workflow" (GitHub Actions source); enablement | |
| # self-heals if Pages is ever disabled. | |
| uses: actions/configure-pages@v6 | |
| with: | |
| enablement: true | |
| - name: Upload Pages artifact (demo + docs) | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: _site | |
| deploy: | |
| name: deploy to GitHub Pages | |
| # Only publish from main / manual dispatch — PRs build + size-gate | |
| # but never deploy. | |
| if: github.event_name != 'pull_request' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |