From c56e7864bb9f5e86f5c1d7815b6829aa7fb351db Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Wed, 17 Jun 2026 00:59:56 +0300 Subject: [PATCH] ci: deploy the wasm web app to GitHub Pages on each release (issue #45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add .github/workflows/pages.yml: on every published release (and manual dispatch) it builds the web bundle with trunk (`--public-url /OpenCADStudio/`, no-default-features so no solid3d/C deps), adds .nojekyll, and publishes dist/ to GitHub Pages. No COOP/COEP needed since wasm runs single-threaded. Enable via repo Settings → Pages → Source: GitHub Actions. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/pages.yml | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..24fe5742 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,61 @@ +# Build the wasm web app and publish it to GitHub Pages on every release +# (issue #45). No threads are used on wasm (rayon runs sequentially), so the +# COOP/COEP headers GitHub Pages can't set are not needed. +name: Deploy web (GitHub Pages) + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# Allow only one Pages deployment at a time. +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + + - uses: Swatinem/rust-cache@v2 + + - name: Install trunk + uses: taiki-e/install-action@v2 + with: + tool: trunk + + # The rust in index.html sets `data-cargo-no-default-features`, + # so this drops the `solid3d` feature (truck-meshalgo → lzma-sys C deps + # that can't cross-compile to wasm). `--public-url` matches the project + # page sub-path: https://.github.io/OpenCADStudio/. + - name: Build web bundle + run: trunk build --release --public-url /OpenCADStudio/ + + # GitHub Pages runs Jekyll, which ignores files; opt out so the + # wasm-bindgen output is served verbatim. + - run: touch dist/.nojekyll + + - uses: actions/upload-pages-artifact@v3 + with: + path: dist + + deploy: + needs: build + runs-on: ubuntu-22.04 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4