-
-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (47 loc) · 1.29 KB
/
wasm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Release
on:
push:
branches:
- main
env:
# update with the name of the main binary
binary: SolarSim
#itch_target: <itch.io-username>/<game-name>
concurrency:
group: "pages"
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
# Build for wasm
release-wasm:
runs-on: ubuntu-latest
steps:
- uses: olegtarasov/[email protected]
id: get_version
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
toolchain: 1.73.0
- name: install wasm-bindgen-cli
run: |
cargo install wasm-bindgen-cli --version 0.2.87
- name: Build
run: |
cargo build --release --target wasm32-unknown-unknown
- name: Prepare package
run: |
wasm-bindgen --no-typescript --out-name Simulation --out-dir wasm --target web target/wasm32-unknown-unknown/release/${{ env.binary }}.wasm
cp -r assets wasm/
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'wasm'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1