Repository navigation
Add minimal Verilog frontend #69
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 NBT Viewer | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/deploy-nbt-viewer.yml' | |
| - 'Cargo.lock' | |
| - 'Cargo.toml' | |
| - 'crates/nbt-sim-wasm/**' | |
| - 'src/**' | |
| - 'tools/nbt-viewer/**' | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - '.github/workflows/deploy-nbt-viewer.yml' | |
| - 'Cargo.lock' | |
| - 'Cargo.toml' | |
| - 'crates/nbt-sim-wasm/**' | |
| - 'src/**' | |
| - 'tools/nbt-viewer/**' | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: tools/nbt-viewer | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm target | |
| run: rustup target add wasm32-unknown-unknown | |
| working-directory: . | |
| - name: Cache Rust build | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| . -> target | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: tools/nbt-viewer/package-lock.json | |
| - name: Install wasm-bindgen CLI | |
| run: cargo install wasm-bindgen-cli --version 0.2.100 --locked | |
| working-directory: . | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Prepare Minecraft block assets | |
| run: npm run prepare:mcmeta | |
| env: | |
| MCMETA_SOURCE_DIR: ${{ github.workspace }}/tools/nbt-viewer/public/mcmeta-source | |
| - name: Build WASM simulator | |
| run: npm run build:wasm | |
| - name: Build viewer | |
| run: npm run build | |
| env: | |
| VITE_BASE_PATH: /redstone-compiler/ | |
| - name: Setup Pages | |
| if: github.event_name != 'pull_request' | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: tools/nbt-viewer/dist | |
| deploy: | |
| if: github.event_name != 'pull_request' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |