-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (46 loc) · 1.48 KB
/
build-github-page.yaml
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
54
55
56
57
58
59
60
name: build-github-page
on: [workflow_dispatch]
# on: [push, workflow_dispatch]
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
# defaults:
# run:
# shell: bash
# working-directory: crates/gbpplanner-rs
jobs:
install-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: install apt dependencies
run: sudo apt-get update; sudo apt-get install -y pkg-config libx11-dev libasound2-dev libudev-dev # libfreetype6-dev libfontconfig1-dev
- name: install mold linker
uses: rui314/setup-mold@v1
- name: install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
# targets: wasm32-unknown-unknown
toolchain: stable
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: install trunk
uses: jetli/[email protected]
with:
version: 'latest'
- name: Build wasm binary
run: |
trunk build --release --public-url /${{ github.event.repository.name }}
working-directory: crates/gbpplanner-rs
- name: optimize Wasm
uses: NiklasEi/wasm-opt-action@v2
with:
file: ./crates/gbpplanner-rs/dist/*.wasm
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
single-commit: true
folder: ./crates/gbpplanner-rs/dist