This guide explains the optimized CI/CD process for FlightAbove, including automated testing, building, and release management.
The CI/CD system consists of two main workflows:
- CI Workflow (
ci.yml) - Runs on every push/PR - Release Workflow (
release.yml) - Handles version management and releases
- ✅ Runs on every push to
mainand pull requests - 🔍 Lints code for quality
- 🧪 Runs tests (if available)
- 🏗️ Builds the application
- 📦 Creates artifacts for releases (on main branch only)
-
Test Job (Ubuntu):
- Installs dependencies with caching
- Runs linting
- Runs tests
- Builds application
- Validates build output
-
Build Job (macOS):
- Only runs on pushes to main branch
- Builds and packages the application
- Uploads DMG files as artifacts
- 🔄 Automatically handles version management
- 📦 Creates new releases or updates existing ones
- 🏷️ Manages GitHub releases and tags
- 🎛️ Supports manual releases via GitHub Actions UI
If you push changes with the same version number:
- ✅ Updates existing release assets
- 📝 Updates release notes with "(Updated)" indicator
- 🔄 Replaces old DMG files with new ones
If you push with a new version:
- 🆕 Creates a new GitHub release
- 🏷️ Creates a new version tag
- 📦 Uploads new DMG files
- 📝 Generates fresh release notes
The release workflow automatically detects version changes from package.json. To update versions:
# Increment patch version (1.0.0 -> 1.0.1)
npm version patch
# Increment minor version (1.0.0 -> 1.1.0)
npm version minor
# Increment major version (1.0.0 -> 2.0.0)
npm version major
# Set specific version
npm version 1.2.3We've created a convenient script for version management:
# Make the script executable (first time only)
chmod +x scripts/version.sh
# Increment patch version
./scripts/version.sh patch
# Increment minor version
./scripts/version.sh minor
# Increment major version
./scripts/version.sh major
# Set specific version
./scripts/version.sh set 1.2.3The script automatically:
- ✅ Updates version in
package.json - 📝 Updates DMG filenames in build scripts
- 📄 Creates/updates
RELEASE.md - 💡 Provides next steps for release
- Go to your repository on GitHub
- Navigate to Actions tab
- Select Release workflow
- Click Run workflow
- Enter the version number (e.g.,
1.0.1) - Click Run workflow
# Create and push a tag
git tag v1.0.1
git push origin v1.0.1- Version Detection: Reads version from
package.json - Release Check: Checks if release already exists
- Asset Management:
- New version: Creates new release
- Same version: Updates existing release
- File Upload: Uploads DMG files for both Intel and Apple Silicon
- Release Notes: Generates comprehensive release notes
FlightAbove-{version}.dmg(Intel Mac)FlightAbove-{version}-arm64.dmg(Apple Silicon)
The workflows use the default GITHUB_TOKEN secret, which is automatically provided by GitHub.
GITHUB_TOKEN: Automatically provided by GitHub ActionsNODE_VERSION: Set to 18 in workflows
# Check if all dependencies are installed
npm ci
# Clear cache and rebuild
npm run clean
npm run build- ✅ Ensure you're on the
mainbranch - ✅ Check that version in
package.jsonis correct - ✅ Verify GitHub Actions have proper permissions
# Ensure build completed successfully
npm run dist
# Check release directory
ls -la release/# Enable verbose logging
DEBUG=* npm run build
# Check workflow logs in GitHub Actions- ✅ npm dependencies cached between runs
- ✅ Node.js installation cached
- ✅ Build artifacts preserved for 30 days
- ✅ Test and build jobs run in parallel when possible
- ✅ Separate environments for testing (Ubuntu) and building (macOS)
- ✅ Uses
npm cifor faster, reliable installs - ✅ Efficient artifact retention (30 days)
- ✅ Conditional job execution to save resources
- ✅ Push to
mainbranch - ✅ Pull requests to
mainbranch
- ✅ Push to
mainbranch - ✅ Push tags starting with
v* - ✅ Manual trigger via GitHub Actions UI
- Use Semantic Versioning:
MAJOR.MINOR.PATCH - Update Version Before Release: Use the version script
- Test Before Release: Ensure CI passes before tagging
- Update Version: Use
./scripts/version.sh patch - Test Changes: Ensure CI workflow passes
- Commit Changes:
git add . && git commit -m "Bump version" - Create Tag:
git tag v{version} - Push Everything:
git push && git push --tags
- Run Linting:
npm run lint - Fix Issues:
npm run lint:fix - Test Locally:
npm run build
# 1. Update version
./scripts/version.sh patch
# 2. Review changes
git diff
# 3. Commit and push
git add .
git commit -m "Bump version to $(node -p "require('./package.json').version")"
git push
# 4. Create tag and push
git tag v$(node -p "require('./package.json').version")
git push --tags- Go to GitHub Actions
- Select "Release" workflow
- Click "Run workflow"
- Enter version number
- Click "Run workflow"
The CI/CD system is designed to be efficient, reliable, and easy to use. It automatically handles the complexity of version management while providing clear feedback and easy troubleshooting.