This repository was archived by the owner on Jul 31, 2026. It is now read-only.
Repository navigation
101 lines (85 loc) · 3.3 KB
/
Copy pathdeploy-installer.yml
File metadata and controls
101 lines (85 loc) · 3.3 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
name: Deploy Web Installer
# Auto-build firmware and publish the Web Installer (web-installer/) to GitHub Pages
# every time main is updated. Binaries are NEVER committed to the repo — they live
# only in the deployed Pages artifact.
on:
push:
branches: [main]
workflow_dispatch: {}
permissions:
contents: read
pages: write
id-token: write
# Don't queue overlapping deploys — newer commit cancels older runs in flight
concurrency:
group: pages
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Cache PlatformIO toolchain
uses: actions/cache@v5
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('platformio.ini') }}
restore-keys: ${{ runner.os }}-pio-
- name: Build firmware
run: pio run
- name: Build LittleFS image
run: pio run -t buildfs
- name: Stage binaries for the Web Installer
run: |
mkdir -p web-installer/firmware
cp .pio/build/esp32dev/firmware.bin web-installer/firmware/
cp .pio/build/esp32dev/bootloader.bin web-installer/firmware/
cp .pio/build/esp32dev/partitions.bin web-installer/firmware/
cp .pio/build/esp32dev/littlefs.bin web-installer/firmware/
# boot_app0.bin is provided by the Arduino-ESP32 framework, copy from cache
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
web-installer/firmware/
echo "── Binaries staged ──"
ls -la web-installer/firmware/
- name: Generate version manifest
run: |
# Extract version from firmware source so it always matches the binary
FW_VERSION=$(grep -m1 'TIGERSCALE_FW_VERSION' src/main.cpp | sed 's/.*"\(.*\)".*/\1/')
GIT_SHA=$(git rev-parse --short HEAD)
GIT_DATE=$(git show -s --format=%cI HEAD)
FW_SHA=$(sha256sum web-installer/firmware/firmware.bin | cut -d' ' -f1)
FS_SHA=$(sha256sum web-installer/firmware/littlefs.bin | cut -d' ' -f1)
cat > web-installer/version.json <<EOF
{
"version": "$FW_VERSION",
"git_sha": "$GIT_SHA",
"git_date": "$GIT_DATE",
"firmware_sha": "$FW_SHA",
"littlefs_sha": "$FS_SHA",
"firmware_url": "https://tigertag-project.github.io/Tiger-Scale/firmware/firmware.bin",
"littlefs_url": "https://tigertag-project.github.io/Tiger-Scale/firmware/littlefs.bin"
}
EOF
echo "── version.json ──"
cat web-installer/version.json
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: web-installer
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v5