This GitHub Action and its core application can generate a control file that can then be used to
generate Debian Packages.
Debian Control File Builder is ideal for applications that require a control to be dynamically generated, such as
generating a Debian Package as part of an automated release with CI/CD.
This GitHub Action and the software included is designed to complement another one of our projects, Debian Packer.
Further Information:
Here is a simple example of how you can use this Action in your Workflow:
name: Debian-Control-File-Build-Example
on:
push:
branches: [ master, main ]
workflow_dispatch:
jobs:
deb-control-file-build:
name: Generate Debian Package
runs-on: ubuntu-24.04
steps:
# Generate Debian control File
- name: Generate Debian control File
uses: Nightwind-Developments/debian-control-file-builder@latest
id: deb_control
# Input Parameters
with:
# Required: Configuration File
config-file: 'path/to/control_configuration_file.json'
# Optional: deps-file
deps-file: 'path/to/product_dependencies_list_file.txt'
# Optional: Custom Output Directory
output-path: 'desired/path/to/generated/file/named/control'
# Optional: Case Sensitive JSON Keys
case-sensitive-keys: 'true'
# Upload the Generated control File as an Artifact
- name: Upload Generated Control File
uses: actions/upload-artifact@v4
with:
name: generated-control-file
path: "${{ steps.deb_control.outputs.control_file_path }}"
if-no-files-found: error| Name | Type | Required | Default | Description |
|---|---|---|---|---|
config-file |
String | Yes | Path to configuration file in JSON format | |
deps-file |
String | No | Path to the file with the list of dependencies to include in the generated control file | |
output-path |
String | No | ${{ github.workspace }}/output/ |
The path to where the generated control file will be saved |
case-sensitive-keys |
String | No | 'true' | Signals whether the JSON keys of the template file require conversion to Debian's Standards (Capitalised first letter, remaining letters lowercase). Use 'true' if keys are already in correct form and conversion is NOT required, 'false' if conversion IS required. |
Example use case for input parameters:
steps:
- name: Step Name
with:
input-name: value| Name | Type | Description |
|---|---|---|
control_file_path |
String | The configured path where the generated control file is saved |
Example use case for output variables:
steps:
- name: Step Name
id: step-id
run: ./
- name: Print Output Variable
run echo "${{ steps.step-id.outputs.output_variable }}"A JSON File, formatted like below, can be used to specify what configurations the control file will have
after generation.
{
"First Configuration Name" : "Value to Assign",
"Second Configuration Name" : "Value to Assign"
}In the following example, only the mandatory fields for Binary Debian Packages have been set.
{
"Package": "PackageName",
"Version": "0.0.0",
"Architecture": "armhf",
"Maintainer": "A. Main-Tainer",
"Description": "This is just a sample control file for a Debian package"
}
This results in a file that looks like this:
Package: PackageName
Version: 0.0.0
Architecture: armhf
Maintainer: A. Main-Tainer
Description: This is just a sample control file for a Debian package
Here is an example of the Dependencies List file:
nano
build-essential
This produces a Depends configuration entry in the control file that looks like this:
Depends: nano, build-essential
The following developers have contributed to this repository:
Copyright (C) 2020 Nightwind Developments hello@nightwind-developments.co.nz
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program, such as below this paragraph. If those links are not accessible, see https://www.gnu.org/licenses/.
The license for code in this repository follows LGPL-3.0-or-later.