-
Notifications
You must be signed in to change notification settings - Fork 2
124 lines (105 loc) · 3.62 KB
/
Copy pathpages.yml
File metadata and controls
124 lines (105 loc) · 3.62 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Deploy site (GitHub Pages)
# Builds the WebUSB wasm node and publishes it as a static site to GitHub Pages
# (https://meshtastic.github.io/meshtasticd-wasm-node/). The compiled node is
# built from a pinned meshtastic/firmware ref with `pio run -e native-wasm`
# (emcc/Asyncify), the @meshtastic/core SDK + page modules are bundled with
# esbuild, and the self-contained _site/ is deployed. Nothing is committed — the
# wasm is rebuilt on every deploy so the site never carries stale binaries.
on:
push:
branches: [main]
paths:
- "web/**"
- "src/**"
- "wasm/**"
- "tools/build-site.mjs"
- "package.json"
- "package-lock.json"
- ".github/workflows/pages.yml"
workflow_dispatch:
inputs:
firmware_ref:
description: "meshtastic/firmware ref to build the wasm node from (default: the pinned FIRMWARE_REF)"
required: false
default: ""
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment; don't cancel an in-progress one (a half-applied
# Pages deploy is worse than waiting).
concurrency:
group: pages
cancel-in-progress: false
env:
# Pinned firmware commit that carries [env:native-wasm]. Bump to update the
# deployed node (point at develop/a tag once native-wasm lands there).
# renovate: datasource=git-refs depName=firmware packageName=https://github.com/meshtastic/firmware
FIRMWARE_REF: e14849a2b8e899a82bdfe4374418593d34cf8844
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout site
uses: actions/checkout@v7
- name: Resolve firmware ref
id: fw
run: echo "ref=${{ github.event.inputs.firmware_ref || env.FIRMWARE_REF }}" >> "$GITHUB_OUTPUT"
- name: Checkout firmware (${{ steps.fw.outputs.ref }})
uses: actions/checkout@v7
with:
repository: meshtastic/firmware
ref: ${{ steps.fw.outputs.ref }}
submodules: recursive
path: firmware
- name: Setup pnpm
uses: pnpm/action-setup@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install site deps
run: pnpm install --frozen-lockfile
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install PlatformIO
run: pip install -U platformio
# Cache PlatformIO's downloaded platform/framework/toolchain packages
# (platform-wasm, framework-portduino, ...). Keyed on the firmware ref so a
# ref bump re-resolves cleanly.
- name: Cache PlatformIO packages
uses: actions/cache@v6
with:
path: ~/.platformio
key: pio-wasm-${{ steps.fw.outputs.ref }}
restore-keys: pio-wasm-
- name: Setup Emscripten SDK
uses: emscripten-core/setup-emsdk@v16
with:
version: 6.0.1
actions-cache-folder: emsdk-cache
- name: Build wasm node (pio run -e native-wasm)
working-directory: firmware
run: platformio run -e native-wasm
- name: Assemble static site
env:
FW: ${{ github.workspace }}/firmware
run: pnpm run build:site
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: _site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5