-
Notifications
You must be signed in to change notification settings - Fork 0
Versioning and Releases
Automated semantic versioning and GitHub releases for the Firebase React Template.
This project uses automated semantic versioning with GitHub Actions. Every merge to the main branch automatically:
- ✅ Determines version bump type from commit messages
- ✅ Creates a new Git tag (v1.0.0 → v1.0.1 → v1.0.2)
- ✅ Updates
package.jsonversion - ✅ Builds the project
- ✅ Creates a GitHub Release with archives
- ✅ Generates release notes from commits
graph TD
A[Merge to main] --> B{Analyze Commit Message}
B -->|breaking:| C[Major v1.0.0 → v2.0.0]
B -->|feat:| D[Minor v1.0.0 → v1.1.0]
B -->|Other| E[Patch v1.0.0 → v1.0.1]
C --> F[Create Git Tag]
D --> F
E --> F
F --> G[Update package.json]
G --> H[Build Project]
H --> I[Create Archives]
I --> J[Generate Release Notes]
J --> K[Publish GitHub Release]
Versions follow semantic versioning (SemVer): vMAJOR.MINOR.PATCH
- MAJOR (v1.0.0 → v2.0.0): Breaking changes
- MINOR (v1.0.0 → v1.1.0): New features (backward compatible)
- PATCH (v1.0.0 → v1.0.1): Bug fixes (backward compatible)
The version bump type is determined by your commit message prefix:
| Commit Prefix | Version Bump | Example | Description |
|---|---|---|---|
breaking: or major:
|
MAJOR | v1.0.0 → v2.0.0 | Breaking changes |
feat: or feature: or minor:
|
MINOR | v1.0.0 → v1.1.0 | New features |
| All others | PATCH | v1.0.0 → v1.0.1 | Bug fixes, docs, etc. |
<type>: <description>
[optional body]
[optional footer]
git commit -m "fix: resolve authentication timeout issue"
git commit -m "docs: update setup guide"
git commit -m "style: format code with prettier"
git commit -m "chore: update dependencies"git commit -m "feat: add dark mode toggle"
git commit -m "feature: implement user profile page"
git commit -m "minor: add email verification"git commit -m "breaking: change authentication API structure"
git commit -m "major: migrate to Firebase v10"sequenceDiagram
participant Dev as Developer
participant GH as GitHub
participant Actions as GitHub Actions
participant Releases as GitHub Releases
Dev->>GH: Push to main branch
GH->>Actions: Trigger release workflow
Actions->>Actions: Get latest tag (v1.0.0)
Actions->>Actions: Analyze commit message
Actions->>Actions: Calculate new version (v1.0.1)
Actions->>Actions: Update package.json
Actions->>Actions: Build project
Actions->>Actions: Create source archive
Actions->>Actions: Create build archive
Actions->>Actions: Generate checksums
Actions->>GH: Create Git tag (v1.0.1)
Actions->>Actions: Generate release notes
Actions->>Releases: Create GitHub Release
Releases->>Dev: ✅ Release published
When you merge to main, the workflow automatically creates:
-
Git Tag:
v1.0.1,v1.0.2, etc. - GitHub Release: With title "Release v1.0.1"
-
Release Assets:
-
firebase-react-template-v1.0.1-source.tar.gz- Full source code -
firebase-react-template-v1.0.1-build.tar.gz- Production build -
checksums.txt- SHA256 checksums for verification
-
The project includes a shell script for manual version bumping:
# Bump patch version (v1.0.0 → v1.0.1)
bash .github/scripts/bump-version.sh patch
# Bump minor version (v1.0.0 → v1.1.0)
bash .github/scripts/bump-version.sh minor
# Bump major version (v1.0.0 → v2.0.0)
bash .github/scripts/bump-version.sh majorIf you need to create a tag manually:
# Create and push a tag
git tag -a v1.0.1 -m "Release v1.0.1"
git push origin v1.0.1
# Update package.json to match
npm version 1.0.1 --no-git-tag-version
git add package.json package-lock.json
git commit -m "chore: bump version to v1.0.1"
git pushVisit: https://github.com/ThanuMahee12/firebase-react-template/releases
Each release includes:
- 📝 Auto-generated release notes from commits
- 📦 Downloadable source code archives
- 🏗️ Pre-built production files
- ✅ SHA256 checksums for verification
- 📅 Release date and tag information
Add to README:
[](https://github.com/ThanuMahee12/firebase-react-template/releases)File: firebase-react-template-v1.0.1-source.tar.gz
Contains the complete template source code (excludes node_modules, .git, dist).
Download and extract:
# Download from GitHub Releases
wget https://github.com/ThanuMahee12/firebase-react-template/releases/download/v1.0.1/firebase-react-template-v1.0.1-source.tar.gz
# Extract
tar -xzf firebase-react-template-v1.0.1-source.tar.gz
# Install and run
cd firebase-react-template
npm install
npm run devFile: firebase-react-template-v1.0.1-build.tar.gz
Contains pre-built production files ready for deployment.
Download and deploy:
# Download from GitHub Releases
wget https://github.com/ThanuMahee12/firebase-react-template/releases/download/v1.0.1/firebase-react-template-v1.0.1-build.tar.gz
# Extract to Firebase hosting directory
tar -xzf firebase-react-template-v1.0.1-build.tar.gz -C dist/
# Deploy to Firebase
firebase deploy --only hostingFile: checksums.txt
Verify download integrity:
# Download checksums file
wget https://github.com/ThanuMahee12/firebase-react-template/releases/download/v1.0.1/checksums.txt
# Verify source archive
sha256sum -c checksums.txt --ignore-missing# List all tags
git tag
# List tags with messages
git tag -n
# Show tag details
git show v1.0.1# Checkout a specific version
git checkout v1.0.1
# Create a branch from a version
git checkout -b fix/from-v1.0.1 v1.0.1
# Return to latest
git checkout mainProblem: GitHub Actions release workflow fails
Solutions:
-
Check permissions:
- Go to Settings → Actions → General
- Under "Workflow permissions", select "Read and write permissions"
-
Verify commit message format:
# Use proper commit format git commit -m "feat: add new feature"
-
Check build errors:
# Test build locally before pushing npm run build
Problem: Trying to create a tag that already exists
Solution:
# Delete local tag
git tag -d v1.0.1
# Delete remote tag
git push origin :refs/tags/v1.0.1
# Recreate tag
git tag -a v1.0.1 -m "Release v1.0.1"
git push origin v1.0.1Problem: package.json version doesn't match Git tag
Solution:
# Get current tag
CURRENT_TAG=$(git describe --tags --abbrev=0)
VERSION=${CURRENT_TAG#v}
# Update package.json
npm version $VERSION --no-git-tag-version
# Commit the change
git add package.json package-lock.json
git commit -m "chore: sync version with tag $CURRENT_TAG"
git pushAlways prefix commits with type indicators:
# Good
git commit -m "feat: add user profile page"
git commit -m "fix: resolve login redirect issue"
# Bad (will default to patch)
git commit -m "added new feature"
git commit -m "bug fix"Before merging to main:
# Run all checks
npm run format:check
npm run lint
npm run build
npm run previewGood commit messages help generate useful release notes:
# Good - descriptive
git commit -m "feat: add Firebase authentication with Google Sign-In"
# Bad - vague
git commit -m "feat: update auth"Don't merge multiple unrelated features at once:
# Good - single feature
git commit -m "feat: add dark mode toggle to settings"
# Bad - multiple features
git commit -m "feat: add dark mode, user profile, and notification system"After a release is created:
- Check the auto-generated release notes
- Edit if necessary on GitHub
- Add additional context if needed
Location: .github/workflows/release.yml
Key Features:
- Auto-detects version bump type
- Updates
package.jsonautomatically - Creates source and build archives
- Generates SHA256 checksums
- Auto-generates release notes from commits
Location: .github/scripts/bump-version.sh
Usage:
bash .github/scripts/bump-version.sh [major|minor|patch]Features:
- Reads latest Git tag
- Calculates next version
- Supports all SemVer bump types
- Compatible with GitHub Actions
The release workflow works alongside the deployment workflow:
graph TD
A[Push to main] --> B[Deploy Workflow]
A --> C[Release Workflow]
B --> D[Format Check]
D --> E[Lint Check]
E --> F[Build]
F --> G[Deploy to Firebase]
C --> H[Calculate Version]
H --> I[Create Tag]
I --> J[Build Project]
J --> K[Create Release]
K --> L[Upload Archives]
Both workflows run independently and in parallel.
- GitHub Actions - CI/CD setup
- Deployment Guide - Deployment process
- Development Workflow - Daily development
Next: GitHub Actions →
Firebase React Template | Made with ❤️ | GitHub | Report Issues
Getting Started
Configuration
Advanced Topics
Deployment
- React 19
- Vite
- Firebase 12
- Redux Toolkit
- React Router