|
| 1 | +--- |
| 2 | +applyTo: ".github/workflows/build-release.yml" |
| 3 | +description: "CI/CD Pipeline configuration for PyInstaller binary packaging and release workflow" |
| 4 | +--- |
| 5 | + |
| 6 | +# CI/CD Pipeline Instructions |
| 7 | + |
| 8 | +## PyInstaller Binary Packaging |
| 9 | +- **CRITICAL**: Uses `--onedir` mode (NOT `--onefile`) for faster CLI startup performance |
| 10 | +- **Binary Structure**: Creates `dist/{binary_name}/apm` (nested directory containing executable + dependencies) |
| 11 | +- **Platform Naming**: `apm-{platform}-{arch}` (e.g., `apm-darwin-arm64`, `apm-linux-x86_64`) |
| 12 | +- **Spec File**: `build/apm.spec` handles data bundling, hidden imports, and UPX compression |
| 13 | + |
| 14 | +## Artifact Flow Quirks |
| 15 | +- **Upload**: Artifacts include both binary directory + test scripts for isolation testing |
| 16 | +- **Download**: GitHub Actions creates nested structure: `{artifact_name}/dist/{binary_name}/apm` |
| 17 | +- **Release Prep**: Extract binary from nested path using `tar -czf "${binary}.tar.gz" -C "${artifact_dir}/dist" "${binary}"` |
| 18 | + |
| 19 | +## Critical Testing Phases |
| 20 | +1. **Integration Tests**: Full source code access for comprehensive testing |
| 21 | +2. **Release Validation**: ISOLATION testing - no source checkout, validates exact shipped binary experience |
| 22 | +3. **Path Resolution**: Use symlinks and PATH manipulation for isolated binary testing |
| 23 | + |
| 24 | +## Release Flow Dependencies |
| 25 | +- **Sequential Jobs**: test → build → integration-tests → release-validation → create-release → publish-pypi → update-homebrew |
| 26 | +- **Tag Triggers**: Only `v*.*.*` tags trigger full release pipeline |
| 27 | +- **Artifact Retention**: 30 days for debugging failed releases |
| 28 | + |
| 29 | +## Key Environment Variables |
| 30 | +- `PYTHON_VERSION: '3.12'` - Standardized across all jobs |
| 31 | +- `GITHUB_TOKEN` - Fallback token for compatibility (GitHub Actions built-in) |
| 32 | + |
| 33 | +## Performance Considerations |
| 34 | +- UPX compression when available (reduces binary size ~50%) |
| 35 | +- Python optimization level 2 in PyInstaller |
| 36 | +- Aggressive module exclusions (tkinter, matplotlib, etc.) |
| 37 | +- Matrix builds across platforms but sequential execution prevents resource conflicts |
0 commit comments