This document outlines the improved build and release process that automates website deployment.
For the best experience, use the PowerShell version which includes interactive prompts and better error handling:
.\build-and-release.ps1This single command will:
- ✅ Build firmware for both board variants
- ✅ Extract version from
Version.h - ✅ Copy files to website releases directory
- ✅ Update release index
- ✅ Optionally auto-commit and push to GitHub
- ✅ Auto-deploy to Cloudflare
.\build-and-release.ps1 [options]Options:
-Clean- Clean build directories first-Release- Build release version-Version "2.3.0"- Set specific version (overrides Version.h)-BuildNumber "123"- Set custom build number
Examples:
# Standard release build (auto-detects version from Version.h)
.\build-and-release.ps1 -Release
# Development build with clean
.\build-and-release.ps1 -Clean
# Custom version override
.\build-and-release.ps1 -Release -Version "2.3.0-beta"build-and-release.bat [options]Same as PowerShell version but without interactive prompts.
build.bat [options]The original build script - still works but doesn't handle website deployment.
When you run build-and-release.ps1, here's what happens:
graph TD
A[Start Build] --> B[Extract Version from Version.h]
B --> C[Run Original Build Script]
C --> D[Create Website Directory Structure]
D --> E[Copy Manifest Files]
E --> F[Copy Firmware Binaries]
F --> G[Update releases/index.json]
G --> H[Prompt: Auto-commit?]
H --> I{User Choice}
I -->|Yes| J[git add, commit, push]
I -->|No| K[Show Manual Instructions]
J --> L[✅ Live on Cloudflare!]
K --> M[Manual: git add, commit, push]
M --> L
After running the enhanced build script:
build-output/
├── latest/
│ ├── manifest-supermini.json # ESP32 Web Tools manifests
│ ├── manifest-xiao.json
│ ├── firmware-supermini.bin # Firmware binaries
│ ├── firmware-xiao.bin
│ ├── bootloader.bin # ESP32 system files
│ ├── partitions.bin
│ └── spiffs.bin
website/
└── releases/
├── index.json # Release index (for APIs)
├── latest/ # Always points to newest
│ ├── manifest-supermini.json
│ ├── manifest-xiao.json
│ └── *.bin
└── v2.2.0/ # Version-specific directory
├── manifest-supermini.json
├── manifest-xiao.json
└── *.bin
The script automatically reads version from include/Version.h:
#define WEIGHMYBRU_VERSION_MAJOR 2
#define WEIGHMYBRU_VERSION_MINOR 2
#define WEIGHMYBRU_VERSION_PATCH 0Results in version: 2.2.0
.\build-and-release.ps1 -Version "2.3.0-beta"When prompted "Would you like to automatically commit and push these changes? (y/N)":
- Type
yto auto-commit and push - Your Cloudflare site updates within 2-3 minutes
git add website/releases/
git commit -m "Release v2.2.0 - Updated firmware manifests"
git push- Update version in include/Version.h
- Run:
.\build-and-release.ps1 -Release - Choose auto-commit when prompted
- ✅ Done! Live in ~3 minutes
- Update version in include/Version.h
- Test locally first:
.\build-and-release.ps1 -Clean - When ready:
.\build-and-release.ps1 -Release - Choose auto-commit when prompted
- Always use
build-and-release.ps1for releases - Update
Version.hbefore building - Test locally before pushing
- Use descriptive commit messages
- Don't manually copy files between directories
- Don't forget to update version in
Version.h - Don't mix development and release builds
- Don't skip testing new versions
- Check PlatformIO is installed:
python -m platformio --version - Try clean build:
.\build-and-release.ps1 -Clean
- Check git is working:
git status - Verify you're in the right directory
- Check file permissions
- Wait 3-5 minutes for Cloudflare deployment
- Check GitHub repo has the new files
- Clear browser cache
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserHappy Building! 🎉