docs/build-workflow.md
This document explains the comprehensive build workflow for g4f that creates packages for multiple platforms and package managers.
The .github/workflows/build-packages.yml workflow automatically builds multiple package formats when a version tag is pushed to the repository.
To trigger a build, push a version tag to the repository:
git tag v1.2.3
git push origin v1.2.3
The workflow will:
You can also manually trigger builds using the workflow_dispatch event:
After a successful build, packages are available:
pip install g4fdocker pull hlohaus789/g4f:latestwinget install g4f (after manifest approval)The workflow handles all dependencies automatically, but for local development:
Key files for customization:
g4f_cli.py - Entry point for executable buildsscripts/build-nuitka.sh - Nuitka build script for all platformsscripts/build-deb.sh - Debian package build scriptwinget/manifests/ - WinGet package manifest templates.github/workflows/build-packages.yml - Main workflow configurationThe workflow supports multiple version sources:
G4F_VERSIONVersion must follow PEP 440 format for PyPI compatibility.
Common issues and solutions:
The workflow uses secure practices:
To improve the build system: