Automated package build system for NurOS in APGv2 format using GitHub Actions.
- Automatic package building from source code
- Strict JSON metadata generation
- MD5 checksums for all files
- Lifecycle scripts support (pre/post install/remove)
- Automatic GitHub Releases with
.apgarchives - Binary deployment to repository root
apger/
├── .github/
│ └── workflows/
│ ├── apger-engine.yml # Reusable workflow
│ └── build.yml # Build trigger
├── .ci/
│ ├── recipe.yaml # Package configuration
│ └── scripts/ # Lifecycle scripts
│ ├── pre-install
│ ├── post-install
│ ├── pre-remove
│ └── post-remove
└── home/ # Optional home directory files
Edit .ci/recipe.yaml for your package:
package:
name: "your-package"
version: "1.0.0"
type: "binary"
architecture: "x86_64"
description: "Package description"
maintainer: "Your Name <email@example.com>"
license: "GPL-3.0"
homepage: "https://example.com"
tags: ["tag1", "tag2"]
dependencies: ["dep1", "dep2 >= 1.0"]
conflicts: []
provides: []
replaces: []
conf: ["/etc/config.conf"]
source:
url: "https://example.com/source-1.0.0.tar.xz"
build:
dependencies: ["build-essential", "libncurses-dev"]
script: "./configure --prefix=/usr && make"
install:
script: "make DESTDIR=\"$DESTDIR\" install"If your build requires additional packages (compilers, libraries), add them to build.dependencies:
build:
dependencies: ["build-essential", "cmake", "libssl-dev"]
script: "./configure --prefix=/usr && make"APGer will automatically install these packages via apt-get before building.
Edit scripts in .ci/scripts/:
pre-install- executed before package installationpost-install- executed after package installationpre-remove- executed before package removalpost-remove- executed after package removal
Available variables in scripts: $PACKAGE_NAME, $PACKAGE_VERSION
Commit and push to main branch to automatically trigger the build:
git add .
git commit -m "Update package configuration"
git push origin mainOr trigger manually via GitHub Actions UI.
Created .apg archive contains:
package-name-version.apg
├── data/ # Installed files (from $DESTDIR)
├── home/ # Home directory files (optional)
├── scripts/ # Lifecycle scripts
├── metadata.json # Package metadata
└── md5sums # File checksums
{
"name": "package-name",
"version": "1.0.0",
"type": "binary",
"architecture": "x86_64",
"description": "Package description",
"maintainer": "Your Name <email@example.com>",
"license": "GPL-3.0",
"tags": ["tag1", "tag2"],
"homepage": "https://example.com",
"dependencies": ["dep1", "dep2 >= 1.0"],
"conflicts": [],
"provides": [],
"replaces": [],
"conf": ["/etc/config.conf"]
}After successful build:
apg_rootcontents are extracted to repository root- Commit is created by
github-actions[bot] - GitHub Release is created with tag
v{version} .apgfile is attached to the release
In another repository, create .github/workflows/build.yml:
name: Build Package
on:
push:
branches:
- main
jobs:
build:
uses: your-username/apger/.github/workflows/apger-engine.yml@main
with:
recipe_path: '.ci/recipe.yaml'
scripts_path: '.ci/scripts'Available during build:
$DESTDIR- installation path for files (apg_root/data/)$PACKAGE_NAME- package name (in scripts)$PACKAGE_VERSION- package version (in scripts)
- Ubuntu runner (GitHub Actions)
yqfor YAML parsingjqfor JSON processingbashfor script execution- Source code must be accessible via URL
binary- executable programslibrary- librariesmeta- meta-packages (dependencies only)
x86_64- AMD64/Intel 64-bitaarch64- ARM 64-bitany- architecture-independent
MIT
AnmiTaliDev anmitali198@gmail.com