Skip to content

Commit

Permalink
Support for web (wasm) build
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRustyPickle authored and PPakalns committed Jan 11, 2025
1 parent 625d0f6 commit ef83a90
Show file tree
Hide file tree
Showing 7 changed files with 4,013 additions and 26 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Github Page for example

on:
push:
branches:
- main
paths:
- 'example/**'
- 'src/**'
- '.github/**'

permissions:
contents: write # for committing to gh-pages branch.

jobs:
build-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup toolchain for wasm
run: |
rustup update stable
rustup default stable
rustup set profile minimal
rustup target add wasm32-unknown-unknown
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "example -> target"
- name: Download and install Trunk binary
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
- name: Build
run: |
cd example
../trunk build --release --public-url ${{ env.public_url }}
env:
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: example/dist
single-commit: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Cargo.lock
/Cargo.lock
target/
dist/
11 changes: 1 addition & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ keywords = ["egui", "flexbox", "taffy", "layout", "ui"]
categories = ["gui"]
license = "MIT"
rust-version = "1.81"
exclude = ["/example", "/.github"]

[dependencies]
egui = { version = "0.30", default-features = false }
Expand All @@ -29,13 +30,3 @@ taffy_default = [
"taffy/grid",
"taffy/std",
]

[dev-dependencies]
eframe = { version = "0.30", default-features = false, features = [
"wgpu",
"accesskit",
"default_fonts",
"wayland",
"web_screen_reader",
"x11",
] }
Loading

0 comments on commit ef83a90

Please sign in to comment.