- Add dev-sim.sh script for building and launching simulator - Add sim alias script for quick access - Add dev workflow script with multiple commands - Update RELEASE.md with development workflow documentation - Fix firmware path handling for SimulIDE integration
7.6 KiB
7.6 KiB
🚀 Luke's Rocket Launcher - Release Management Guide
📋 Quick Reference
Branch Types & Naming
main- Production-ready code, always deployabledevelop- Integration branch for featuresfeature/*- New features (fromdevelop)bugfix/*- Bug fixes (frommain)release/*- Release preparation (fromdevelop)hotfix/*- Urgent fixes (frommain)
Release Commands
# Start a new release
./scripts/release.sh 0.1.0 start
# Finish a release (creates tag, merges to main/develop)
./scripts/release.sh 0.1.0 finish
# Create a new branch
./scripts/create-branch.sh feature new-feature-name
🌿 Git Branching Model
Main Branches
main- Always contains production-ready codedevelop- Integration branch for upcoming releases
Supporting Branches
feature/*- New features (branch fromdevelop, merge back todevelop)bugfix/*- Bug fixes (branch frommain, merge back tomain)release/*- Release preparation (branch fromdevelop, merge to bothmainanddevelop)hotfix/*- Critical fixes (branch frommain, merge to bothmainanddevelop)
🚀 Release Process
1. Start a Release
# Create release branch from develop
./scripts/release.sh 0.1.0 start
# This will:
# - Switch to develop branch
# - Create release/0.1.0 branch
# - Push to remote
2. Prepare the Release
- Update version numbers in code
- Update CHANGELOG.md
- Update documentation
- Test thoroughly
3. Finish the Release
# Complete the release process
./scripts/release.sh 0.1.0 finish
# This will:
# - Merge release branch to main
# - Create and push tag v0.1.0
# - Merge release branch to develop
# - Clean up release branch
# - Trigger automated workflow
⚡ Automated Pipeline
What Happens Automatically
- Tag Push triggers GitHub Actions workflow
- Workflow Builds firmware (hardware + simulation)
- Workflow Creates GitHub release
- Workflow Uploads assets to release
- Workflow Publishes to GitHub Packages
No Manual Steps Needed
- ❌ Don't manually create GitHub releases
- ❌ Don't manually upload assets
- ✅ Just run the release script
- ✅ Let the workflow handle everything else
🔧 Branch Management
Create New Branches
# Feature branch (from develop)
./scripts/create-branch.sh feature new-feature-name
# Bugfix branch (from main)
./scripts/create-branch.sh bugfix bug-description
# Hotfix branch (from main)
./scripts/create-branch.sh hotfix urgent-fix-description
Branch Protection Rules
main- Requires PR, no direct pushesdevelop- Requires PR, no direct pushes- Feature branches - Can be pushed directly
📝 Pull Request Workflow
1. Create PR
# From feature branch to develop
gh pr create --base develop --head feature/new-feature
# From develop to main (for releases)
gh pr create --base main --head develop
2. Review & Merge
- Self-review is allowed (you're the only person)
- Merge when ready
- Delete feature branch after merge
🏷️ Version Management
Semantic Versioning
- Major.Minor.Patch (e.g., 1.2.3)
- Major - Breaking changes
- Minor - New features, backward compatible
- Patch - Bug fixes, backward compatible
Pre-releases
- Use for development/testing versions
- Example: 0.1.0 (pre-release)
- Mark as pre-release in GitHub
🚨 Troubleshooting
Common Issues
"already_exists" Error
- Cause: Manual GitHub release conflicts with workflow
- Solution: Don't manually create releases, let workflow handle it
Workflow Not Running
- Cause: Branch protection rules
- Solution: Create PR and merge to main/develop
Asset Upload Failures
- Cause: Missing upload_url
- Solution: Ensure workflow creates release (don't skip creation)
Reset Release
# Delete local tag
git tag -d v0.1.0
# Delete remote tag
git push origin --delete v0.1.0
# Delete GitHub release manually on GitHub
# Start over with release script
📚 File Structure
Lukes-Rocket-Launcher/
├── .github/
│ ├── workflows/c-cpp.yml # Main CI/CD workflow
│ ├── CODEOWNERS # Code ownership rules
│ └── pull_request_template.md # PR template
├── scripts/
│ ├── release.sh # Release management
│ ├── create-branch.sh # Branch creation
│ ├── setup-branch-protection.sh # Branch protection setup
│ ├── dev-sim.sh # Development simulator launcher
│ └── sim # Quick simulator alias
├── code/RocketLauncher/ # Main firmware code
├── wiring/ # SimulIDE wiring files
└── RELEASE.md # This file
🖥️ Development Environment
Local Development Tools
- PlatformIO - Arduino framework and build system
- SimulIDE - Arduino simulator for testing
- CMake - IDE integration and native testing
- Unity - Unit testing framework
Quick Development Commands
# Launch simulator (builds + opens SimulIDE)
./scripts/sim
# Clean rebuild
./scripts/sim --clean
# Run tests
cd code/RocketLauncher && pio test -e native
# Build hardware firmware
cd code/RocketLauncher && pio run -e uno_hw
🎯 Best Practices
Do's
- ✅ Use semantic versioning
- ✅ Test before releasing
- ✅ Update documentation
- ✅ Let automation handle releases
- ✅ Use descriptive branch names
Don'ts
- ❌ Don't manually create GitHub releases
- ❌ Don't push directly to main/develop
- ❌ Don't skip testing
- ❌ Don't forget to update version numbers
🔄 Daily Workflow
Normal Development
- Create feature branch:
./scripts/create-branch.sh feature new-feature - Make changes and commit
- Test locally:
./scripts/sim(builds and launches simulator) - Push and create PR to develop
- Merge when ready
Local Development Cycle
# Quick simulator launch (builds + launches SimulIDE)
./scripts/sim
# Force clean rebuild
./scripts/sim --clean
# Run unit tests
cd code/RocketLauncher && pio test -e native
# Build hardware firmware
cd code/RocketLauncher && pio run -e uno_hw
Release Day
- Start release:
./scripts/release.sh 1.0.0 start - Prepare release (version, docs, testing)
- Finish release:
./scripts/release.sh 1.0.0 finish - Wait for automation to complete
- Deploy and announce
📞 Quick Commands Reference
# Branch Management
./scripts/create-branch.sh feature new-feature
./scripts/create-branch.sh bugfix bug-description
./scripts/create-branch.sh hotfix urgent-fix
# Release Management
./scripts/release.sh 1.0.0 start
./scripts/release.sh 1.0.0 finish
# Git Operations
git checkout develop
git pull origin develop
git checkout main
git pull origin main
# Workflow Monitoring
gh run list --limit 5
gh run view <run-id>
🎉 Success Indicators
Release Completed Successfully When:
- ✅ All workflow jobs show green checkmarks
- ✅ GitHub release exists with assets
- ✅ Firmware files are uploaded
- ✅ No "already_exists" errors
- ✅ Asset uploads complete
If Something Goes Wrong:
- Check workflow logs:
gh run view <run-id> - Look for error messages
- Check if release already exists on GitHub
- Reset and try again if needed
This guide covers the complete release pipeline. When in doubt, run the scripts and let automation handle the complexity! 🚀