This directory contains GitHub Actions workflows and supporting scripts for the HALPI2 firmware repository.
Runs on every pull request to validate code quality:
- Cargo check
- Clippy lints
- Build verification
Automatically creates draft releases when code is pushed to main:
- Triggers on push to main branch
- Builds all release artifacts (firmware, bootloader, Debian package)
- Generates polished release notes from commit history
- Creates draft release with all artifacts
Smart Release Logic:
- Skips if a published release already exists for the version
- Deletes and recreates if a draft exists
Triggers when a draft release is published:
- Notifies the APT repository to pull new packages
- Simple webhook-based notification
Generates polished release notes from git commit history using conventional commit format.
Requirements:
git- For commit history analysisbash4.0+ - For string manipulation features (parameter expansion)ghCLI - For release API access (used in workflows only)
Usage:
.github/scripts/generate-release-notes.sh <version> [last_tag] [repository] [template_path]Arguments:
version(required): Version number (e.g., "3.2.0")last_tag(optional): Previous release tag for changelog range (e.g., "v3.1.1")repository(optional): GitHub repository in owner/repo format (default: "hatlabs/HALPI2-firmware")template_path(optional): Path to release notes template (default: auto-detected)
Example:
# Generate notes for v3.2.0 since v3.1.1
.github/scripts/generate-release-notes.sh "3.2.0" "v3.1.1"
# Generate notes for first release (all commits)
.github/scripts/generate-release-notes.sh "1.0.0"How it works:
- Analyzes git commit history using conventional commit patterns
- Categorizes commits by type (feat, fix, refactor, docs, etc.)
- Populates the template with categorized commits
- Outputs markdown-formatted release notes
Conventional Commit Types:
feat:→ ✨ New Featuresfix:→ 🐛 Bug Fixesrefactor:,perf:,chore:→ 🔧 Improvementsdocs:→ 📚 Documentation
Template for generating release notes. Uses placeholders that are replaced by the script:
{{VERSION}}- Version number{{FEATURES}}- New features section (with header){{FIXES}}- Bug fixes section (with header){{IMPROVEMENTS}}- Improvements section (with header){{DOCS}}- Documentation section (with header){{CHANGELOG_LINK}}- Link to GitHub compare view
Customizing the template:
You can edit the template to change the structure, wording, or add new sections. The script will automatically use your changes.
Example additions:
- Add upgrade warnings section
- Include breaking changes notice
- Add testing instructions
- Customize installation methods
- Update version: Update
firmware/VERSIONand commit - Push to main:
git push origin main - Draft created: Workflow automatically creates draft release with:
- All build artifacts
- Auto-generated release notes from commits
- Review & edit:
- Open the draft release on GitHub
- Edit the "What's New" section to highlight key changes
- Review auto-generated changelog sections
- Publish: Click "Publish release" when ready
- APT update: Release workflow triggers APT repository update
# Test with current commits since last release
VERSION=$(cat firmware/VERSION)
LAST_TAG=$(git describe --tags --abbrev=0)
.github/scripts/generate-release-notes.sh "$VERSION" "$LAST_TAG"- Edit
.github/templates/release-notes.md.template - Test locally with the script
- Commit and push - next release will use updated template
View workflow runs in the Actions tab of your repository.
Common issues:
- Draft not created: Check if published release already exists for version
- Build failures: Check cargo/rust toolchain in build step logs
- Missing artifacts: Verify build-info.txt shows expected files