ZGS (ZIT General Software Source) is a general-purpose Debian software
repository maintained by ZIT Studio. It automatically builds amd64 .deb
packages from upstream GitHub projects, signs them, and publishes them as an
apt repository hosted at https://apt-general.zitzhen.cn.
ZGS came after zhento-Software-Source and kzhento-Software-Source, and reuses the vast majority of their code (the build scripts, CI workflows, publishing process, and signing mechanism are essentially identical).
Unlike the first two, which target ZhenTo (and its derivative distributions), ZGS is a general-purpose software repository:
It is not limited to use within ZhenTo — it works on every Debian-based distribution (Debian, Ubuntu, Linux Mint, Deepin, UOS, Kali, and all manner of Debian/Ubuntu derivatives).
In other words, any Debian-based system can add this repository and install its software, provided the architecture and dependency requirements are met.
The repository is driven by a Software.list manifest file, with each line
pointing to an upstream GitHub repository that contains a debian/ packaging
directory. A manually triggered GitHub Actions workflow:
- Parses
Software.listand produces a build matrix, optionally narrowed to the repositories given in the manual run'srepositoriesinput (see Building only selected repositories); - Clones each upstream repository, installs its build dependencies with
mk-build-deps, and runsdpkg-buildpackage -b -us -ucto produceamd64binary packages; - Generates the apt indexes and
Releasemetadata withdpkg-scanpackages/apt-ftparchive; - Signs
InRelease/Release.gpgwith the GPG private key and exports the public key; - Generates a browsable
index.htmlfor the repository root and every subdirectory, so https://apt-general.zitzhen.cn can be explored in a browser like an Apache directory listing; - Writes the log of every package build to
/log/<owner>-<repo>.logand publishes it next to the packages (see Build logs); - Syncs the repository to Cloudflare R2 via
aws s3 syncforaptto fetch. Theindex.htmlfiles are uploaded separately with atext/htmlcontent type, the logs withtext/plain, and both with a shortmax-age, so browsers render them instead of downloading them. Build logs are archived per run underlog/<date>-<run-id>/and are never pruned automatically.
ZGS/
├── Software.list # Upstream software manifest (one GitHub repo URL per line)
├── scripts/
│ ├── parse-software-list.sh # Parses the manifest, emits the build-matrix JSON
│ ├── select-software.sh # Validates and applies the optional repository filter
│ ├── merge-artifacts.sh # Re-indexes published packages a filtered run skipped
│ ├── diff-software-list.sh # Computes repositories newly added since a base revision
│ ├── build-deb.sh # Builds an amd64 .deb from an upstream repository
│ ├── publish-repo.sh # Assembles, signs, and exports the apt metadata
│ ├── collect-logs.sh # Copies build logs into /log/<run-dir>/ in the tree
│ ├── log-file-name.sh # Derives the published log name from a repo URL
│ ├── log-run-dir.sh # Derives the per-run archive directory name
│ ├── stage-log-index.sh # Rebuilds /log/ from all run directories
│ ├── stage-log-repo.sh # Stages a run's logs into the log repository
│ ├── render-log-readme.sh # Rebuilds the log repository README index
│ ├── publish-log-release.sh # Publishes a release with the run's logs
│ ├── github-app-token.sh # Mints a GitHub App installation token
│ ├── generate-index.sh # Writes browsable index.html files for the tree
│ ├── test-workflow-build-step.sh # Runs a workflow run: block under bash
│ └── test-repository-filter.sh # Tests the repository filter and artifact merge
├── .github/workflows/ # Build-check and publish CI
├── .githooks/ # Versioned Git hooks for DCO sign-off
├── CONTRIBUTING.md # Contribution guide
└── LICENSE # AGPL-3.0-only
On any Debian-based distribution, import the signing key and add the source:
# Import the repository signing key
sudo curl -fsSL https://apt-general.zitzhen.cn/apt-key.asc | sudo gpg --dearmor \
-o /etc/apt/trusted.gpg.d/zgs.gpg
# Add the repository source (works across Debian-family distributions)
echo "deb https://apt-general.zitzhen.cn stable main" \
| sudo tee /etc/apt/sources.list.d/zgs.list
# Update and install
sudo apt-get update
sudo apt-get install <package-name>The repository currently publishes packages for the
amd64architecture, thestablesuite, and themaincomponent only.
Open https://apt-general.zitzhen.cn in a browser: the root and every
subdirectory (pool/, dists/stable/, log/, ...) expose a generated
index.html that lists files and folders with sizes and modification times.
On a Debian/Ubuntu environment (CI runs on ubuntu-latest), install the
dependencies and try a build:
sudo apt-get update
sudo apt-get install -y git devscripts equivs dpkg-dev gnupg apt-utils
# Validate the manifest
./scripts/parse-software-list.sh Software.list
# Try building a specific upstream repository (log is optional)
./scripts/build-deb.sh https://github.com/zitzhen/patchsplit /tmp/debs /tmp/logs/patchsplit.logEvery publish run archives the build log of each package into its own directory, so past runs are kept instead of being overwritten:
https://apt-general.zitzhen.cn/log/ # every run
https://apt-general.zitzhen.cn/log/2026-12-01-46640252167/ # one run
https://apt-general.zitzhen.cn/log/2026-12-01-46640252167/zitzhen-patchsplit.log
- The run directory is
<date>-<run-id>(2026-12-01-46640252167): the current UTC date plus the numeric run id, produced byscripts/log-run-dir.sh. The date is read from the clock inside the script rather than passed in from the workflow, because a timestamp taken from an unknowngithubcontext field is silently substituted with an empty string. Each run therefore gets a fresh directory and nothing from an earlier run is replaced. - Inside a run directory the file name is
<owner>-<repo>.log, derived from theSoftware.listURL (https://github.com/zitzhen/patchsplit→zitzhen-patchsplit.log). - Each log starts with the upstream URL, start time, runner and commit, and ends
with the finish time and the build's exit status, so a failed build is
diagnosable without opening the Actions run. The
runline links straight back to the workflow run that produced it. scripts/build-deb.shtakes an optional third argument for the log path. When it is omitted, nothing is written; the build behaves exactly as before.- The logs are staged into the repository tree before
publish-repo.shgenerates the indexes, solog/appears in the root listing at https://apt-general.zitzhen.cn alongsidedists/andpool/. - The
/log/listing is rebuilt from the run directories that actually exist in the bucket, so older runs stay browsable. It is done with a delimiter-basedlist-objects-v2, which keeps the listing cheap however many runs accumulate. Only that oneindex.htmlis regenerated: the per-run indexes come frompublish-repo.sh, and rebuilding the listing must never overwrite them. - Nothing is deleted from
/log/: the sync runs without--delete, so archiving a new run never removes an old one. Pruning is a manual decision. - Logs are public and served with
Cache-Control: no-cache. Never let a build print secrets (tokens, credentials) into them; the workflow only publishes what the build itself wrote.
Every publish also mirrors the same logs into
zitzhen/ZGS-build-log, which uses the
same <date>-<run-id>/<owner>-<repo>.log layout:
- The README there is regenerated on every publish and carries an index of all archived runs, newest first, linking each run's directory and release.
- A release named after the run (
2026-12-01-46640252167) is created with the run's log files attached as assets, so a run can be downloaded without cloning. Each release starts as a draft, receives its assets, and is published last: the repository has immutable releases enabled, and GitHub rejects asset uploads to an already published release. - Commits are made on
mainaszgs-software[bot](363535165+zgs-software[bot]@users.noreply.github.com). - Authentication uses a GitHub App installation token minted by
scripts/github-app-token.shfrom theAPP_KEYsecret, so no long-lived personal token is involved. The job runs alongside the R2 publication, so a failure there never blocks an apt release.
Append a GitHub repository URL (containing a debian/ directory) to
Software.list, one per line, and open a pull request. After merging, a
maintainer manually triggers the Publish apt repository to R2 workflow to
publish. See CONTRIBUTING.md for details.
Manifest rules (enforced by scripts/parse-software-list.sh):
- One HTTPS GitHub repository URL per line, e.g.
https://github.com/zitzhen/patchsplit; - A trailing
.gitor/is accepted and normalized; - Blank lines and lines starting with
#are ignored; inline#comments are stripped; - Duplicate URLs are ignored (a warning is printed);
- The upstream repository must contain a valid
debian/directory and produce anamd64.deb.
The Publish apt repository to R2 workflow has an optional repositories
input, so a maintainer can rebuild one or a few packages instead of the whole
manifest. Leave it empty to build every entry, which is the previous behaviour.
The input is a comma-separated list of repository URLs on a single line, for example:
https://github.com/zitzhen/patchsplit,https://github.com/zitzhen/GitTune
Rules enforced by scripts/select-software.sh:
- Surrounding spaces are ignored, a trailing
.gitor/is normalized, and the full-width comma,and the ideographic comma、are accepted, because the field is typed by hand; - Every URL must already be listed in
Software.list. A URL that is missing from the manifest (or is not a GitHub repository URL at all) fails thepreparejob, so no package is built by that run. Add the repository to the manifest first; - The matrix follows the manifest order, and repeated URLs are selected once.
Publishing is unaffected by the filter: the publish job downloads the
previously published .deb files from the bucket and re-indexes them together
with the packages just built, keeping only the newest version of each package
and always preferring the freshly built one. A filtered run therefore never
removes another package from the apt index. See scripts/merge-artifacts.sh.
This project is released under AGPL-3.0-only. All commits must follow
the DCO (Signed-off-by trailer); enable the versioned hooks after cloning to
add the sign-off automatically:
git config core.hooksPath .githooksContributions via issues and pull requests are welcome; see CONTRIBUTING.md.