Skip to content

Commit dc17a13

Browse files
committed
fixed wasm file name
1 parent 4f78cc1 commit dc17a13

File tree

1 file changed

+11
-112
lines changed

1 file changed

+11
-112
lines changed

.github/workflows/deploy.yml

Lines changed: 11 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,3 @@
1-
# name: Deploy to GitHub Pages
2-
3-
# on:
4-
# push:
5-
# branches: [ deploy ]
6-
# workflow_dispatch:
7-
8-
# permissions:
9-
# contents: write
10-
11-
# jobs:
12-
# build-and-deploy:
13-
# runs-on: ubuntu-latest
14-
# steps:
15-
# - uses: actions/checkout@v2
16-
# with:
17-
# fetch-depth: 2 # Need history to check for changes
18-
19-
# - name: Check for Rust changes
20-
# id: check_changes
21-
# run: |
22-
# # Check if any Rust files or Cargo.toml have changed
23-
# if git diff --name-only HEAD^ HEAD | grep -qE '\.rs$|Cargo.toml|Cargo.lock'; then
24-
# echo "rust_changed=true" >> $GITHUB_OUTPUT
25-
# else
26-
# echo "rust_changed=false" >> $GITHUB_OUTPUT
27-
# fi
28-
29-
# - name: Install Rust
30-
# if: steps.check_changes.outputs.rust_changed == 'true'
31-
# uses: actions-rs/toolchain@v1
32-
# with:
33-
# toolchain: stable
34-
# target: wasm32-unknown-unknown
35-
# override: true
36-
37-
# - name: Install wasm-bindgen-cli
38-
# if: steps.check_changes.outputs.rust_changed == 'true'
39-
# run: cargo install -f wasm-bindgen-cli --version 0.2.95
40-
41-
# - name: Create deployment directory
42-
# run: mkdir -p dist
43-
44-
# - name: Build WASM
45-
# if: steps.check_changes.outputs.rust_changed == 'true'
46-
# run: |
47-
# cargo build --release --target wasm32-unknown-unknown
48-
# wasm-bindgen --out-dir ./dist/out/ --target web ./target/wasm32-unknown-unknown/release/bevy_compute_shader.wasm
49-
50-
# - name: Copy existing WASM files
51-
# if: steps.check_changes.outputs.rust_changed == 'false'
52-
# run: |
53-
# # Get the files from the previous gh-pages build
54-
# git fetch origin gh-pages
55-
# git checkout origin/gh-pages -- out
56-
# cp -r out dist/
57-
58-
# - name: Copy web files
59-
# run: |
60-
# cp index.html dist/
61-
# cp styles.css dist/
62-
# cp -r assets dist/
63-
64-
# - name: List files for debugging
65-
# run: |
66-
# echo "Deployment directory contents:"
67-
# ls -la dist/
68-
# echo "\nOut directory contents:"
69-
# ls -la dist/out/
70-
# echo "\nAssets directory contents:"
71-
# ls -la dist/assets/
72-
73-
# - name: Deploy to GitHub Pages
74-
# uses: JamesIves/github-pages-deploy-action@v4
75-
# with:
76-
# folder: dist
77-
# branch: gh-pages
78-
# clean: true
79-
801
name: Deploy to GitHub Pages
812

823
on:
@@ -93,56 +14,34 @@ jobs:
9314
steps:
9415
- uses: actions/checkout@v2
9516
with:
96-
fetch-depth: 2 # Need history to check for changes
97-
98-
- name: Check for Rust changes
99-
id: check_changes
100-
run: |
101-
# Check if any Rust files or Cargo.toml have changed
102-
if git diff --name-only HEAD^ HEAD | grep -qE '\.rs$|Cargo.toml|Cargo.lock'; then
103-
echo "rust_changed=true" >> $GITHUB_OUTPUT
104-
else
105-
echo "rust_changed=false" >> $GITHUB_OUTPUT
106-
fi
107-
108-
- name: Check if gh-pages exists
109-
id: check_ghpages
110-
run: |
111-
if git ls-remote --heads origin gh-pages | grep -q 'gh-pages'; then
112-
echo "branch_exists=true" >> $GITHUB_OUTPUT
113-
else
114-
echo "branch_exists=false" >> $GITHUB_OUTPUT
115-
fi
17+
fetch-depth: 2
11618

11719
- name: Install Rust
118-
if: steps.check_changes.outputs.rust_changed == 'true'
11920
uses: actions-rs/toolchain@v1
12021
with:
12122
toolchain: stable
12223
target: wasm32-unknown-unknown
12324
override: true
25+
26+
- name: Add WASM target
27+
run: rustup target add wasm32-unknown-unknown
28+
29+
- name: Install dependencies
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y pkg-config libudev-dev libasound2-dev
12433
12534
- name: Install wasm-bindgen-cli
126-
if: steps.check_changes.outputs.rust_changed == 'true'
12735
run: cargo install -f wasm-bindgen-cli --version 0.2.95
12836

12937
- name: Create deployment directory
13038
run: mkdir -p dist
13139

132-
- name: Build WASM
133-
if: steps.check_changes.outputs.rust_changed == 'true' || steps.check_ghpages.outputs.branch_exists == 'false'
40+
- name: Build WASM (with verbose output)
13441
run: |
135-
cargo build --release --target wasm32-unknown-unknown
42+
cargo build --release --target wasm32-unknown-unknown -v
13643
wasm-bindgen --out-dir ./dist/out/ --target web ./target/wasm32-unknown-unknown/release/bevy_vaporwave.wasm
13744
138-
- name: Copy existing WASM files
139-
if: steps.check_changes.outputs.rust_changed == 'false' && steps.check_ghpages.outputs.branch_exists == 'true'
140-
run: |
141-
# Get the files from the previous gh-pages build
142-
git fetch origin gh-pages
143-
git checkout origin/gh-pages -- out
144-
cp -r out dist/
145-
14645
- name: Copy web files
14746
run: |
14847
cp index.html dist/

0 commit comments

Comments
 (0)