This document describes the automated release process for LightNVR.
The release process has been fully automated to eliminate manual steps and ensure consistency. The key improvements include:
- Automated version bumping across all project files
- Web assets built during CI/CD (not checked into git)
- Single command release process
- Consistent versioning across CMakeLists.txt, package.json, and generated files
To create a new release, simply run:
./scripts/release.sh 0.13.0This single command will:
- Bump the version in all necessary files
- Commit the changes
- Create a git tag
- Push to GitHub
- Trigger GitHub Actions to build and publish Docker images
The version is managed in the following files:
CMakeLists.txt- Main project version (line 2)web/package.json- Web interface versioninclude/core/version.h- Generated from templateweb/js/version.js- Generated for web interface
If you need to bump the version without creating a release:
./scripts/bump-version.sh 0.13.0This will:
- Update
CMakeLists.txtwith the new version - Update
web/package.jsonwith the new version - Regenerate
include/core/version.hfrom the template - Regenerate
web/js/version.jswith the new version
Note: This does NOT commit the changes. You'll need to commit them manually.
The recommended way to create a release is using the automated script:
./scripts/release.sh 0.13.0-
Pre-flight checks:
- Verifies git working directory is clean
- Checks you're on the main branch (warns if not)
- Validates version format (MAJOR.MINOR.PATCH)
- Ensures the tag doesn't already exist
-
Version bumping:
- Runs
bump-version.shto update all version files
- Runs
-
Git operations:
- Commits all changes with message: "Bump version to X.Y.Z"
- Creates an annotated git tag: "vX.Y.Z"
- Pushes commits and tags to GitHub
-
CI/CD trigger:
- GitHub Actions automatically starts building Docker images
- Web assets are built during the Docker build process
# Normal release (bumps version, commits, tags, and pushes)
./scripts/release.sh 0.13.0
# Dry run (prepares release locally but doesn't push)
./scripts/release.sh 0.13.0 --no-push
# Show help
./scripts/release.sh --helpWhen you push a tag, GitHub Actions automatically:
-
Builds Docker images for multiple architectures:
- linux/amd64
- linux/arm64
- linux/arm/v7
-
Builds web assets during the Docker build:
- Installs Node.js 20.x LTS
- Runs
npm ci --omit=devto install production dependencies only - Runs
npm run buildto build with Vite - Copies built assets to
/usr/share/lightnvr/web-template/
-
Publishes images to GitHub Container Registry:
ghcr.io/opensensor/lightnvr:latest(for main branch)ghcr.io/opensensor/lightnvr:0.13.0(for version tags)ghcr.io/opensensor/lightnvr:0.13(major.minor)ghcr.io/opensensor/lightnvr:0(major only)
-
Creates multi-arch manifest combining all platform images
Important: Web assets (web/dist/) are NOT checked into git anymore.
- Reduces repository size - No binary assets in git history
- Cleaner git diffs - Only source code changes are tracked
- Prevents inconsistencies - Assets are always built from source
- Simplifies workflow - No need to remember to rebuild assets
- During Docker builds - GitHub Actions builds them automatically
- For local development - Run
npm run buildin theweb/directory - For local testing - Run
./scripts/build_web_vite.sh
For local development, you can:
# Start development server (with hot reload)
cd web
npm run start
# Build for production (creates web/dist/)
cd web
npm run build
# Or use the build script
./scripts/build_web_vite.shNote: The web/dist/ directory is in .gitignore and will not be committed.
LightNVR follows Semantic Versioning:
- MAJOR version: Incompatible API changes
- MINOR version: New functionality (backwards compatible)
- PATCH version: Bug fixes (backwards compatible)
Examples:
0.12.8→0.13.0(new features)0.13.0→0.13.1(bug fixes)0.13.1→1.0.0(major release with breaking changes)
You have uncommitted changes. Either commit them or stash them:
git status
git add -A && git commit -m "Your changes"
# or
git stashThe version tag already exists. Either:
- Use a different version number
- Delete the existing tag (if it was a mistake):
git tag -d v0.13.0 git push origin :refs/tags/v0.13.0
The version format in CMakeLists.txt is incorrect. It should be:
project(LightNVR VERSION 0.13.0 LANGUAGES C CXX)If the Docker build fails to find web assets:
- Check that Node.js was installed correctly in the Dockerfile
- Verify
npm run buildcompleted successfully - Check the build logs for errors
This can happen if you have different Node.js versions. The Docker build uses Node.js 20.x LTS. To match locally:
# Install Node.js 20.x
# Then rebuild
cd web
rm -rf node_modules package-lock.json
npm install
npm run buildIf you have an existing checkout with web/dist/ tracked in git:
# Remove web/dist from git tracking
git rm -r --cached web/dist/
# Commit the removal
git commit -m "Remove web/dist from git tracking"
# The .gitignore already excludes web/dist/The buildroot package will need to be updated to:
- Install Node.js as a build dependency
- Run
npm ci && npm run buildin the web directory - Copy the built assets from
web/dist/to the target
Alternatively, you can download pre-built releases from GitHub and extract the web assets from the Docker image.
The new release process is:
- One command:
./scripts/release.sh X.Y.Z - Automatic builds: GitHub Actions builds everything
- No manual steps: Version bumping, tagging, and pushing are automated
- Clean repository: No binary assets in git
This ensures consistency, reduces errors, and makes releases faster and more reliable.