Create Python distribution packages: source, wheel and Debian packages
- Create Python source and wheel packages
- Create Debian packages from Python projects (supports FPM and dh-virtualenv packaging)
- Cross-platform package creation using QEMU, Docker buildx and devcontainer
package-version
: Version of the package to create (if not provided, will use the given git tag)use-devcontainer
: Create packages using a devcontainer (default:false
)pre-build-command
: Command to run before the package creationpost-build-command
: Command to run after the package creationinstall-packaging-tools
: Install Python packaging tools (default:true
)add-source-dist
: Add source distribution to the package creation (default:true
)add-wheel-dist
: Add wheel distribution to the package creation (default:true
)debian-dist-type
: Type of the Debian package to create:fpm-deb
/dh-virtualenv
/none
(default:none
)debian-dist-command
: Command to run for the Debian package creation
python-version
: Python version to use for the package creation (default:3.9
)
free-disk-space
: Free up disk space before build (default:false
)docker-registry
: Docker registry to use (default:docker.io
)docker-username
: Docker registry usernamedocker-password
: Docker registry passwordcontainer-platform
: Devcontainer platform (eg.linux/amd64,linux/arm64,linux/arm/v7
, default:linux/amd64
)container-config
: Devcontainer configuration selector.devcontainer/<config>/devcontainer.json
(if not specified, it will use.devcontainer/devcontainer.json
)packaging-folder
: Optional subfolder for running the packaging command (default:.
)
upload-name
: Name of the uploaded artifact (repository name)
Will generate source and wheel packages. In addition, it will create a Debian package using FPM: python3-.deb Upon installing on a Debian system, it will install the library to the system's Python3 environment.
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EffectiveRange/python-package-github-action@v1
with:
debian-dist-type: 'fpm-deb'
Will generate source and wheel packages. In addition, it will create a Debian package using dh-virtualenv: .deb
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EffectiveRange/python-package-github-action@v1
with:
debian-dist-type: 'dh-virtualenv'
Will build the platform dependent packages in a devcontainer using a build script or command.
Note
The application should have a devcontainer.json
configuration with the necessary setup.
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EffectiveRange/python-package-github-action@v1
with:
use-devcontainer: 'true'
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
docker-password: ${{ secrets.DOCKERHUB_TOKEN }}
container-platform: 'linux/arm/v7'
container-config: 'arm32v7'
debian-dist-command: 'pack_python . --all'