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.zitzhen.cn.
Migration notice: the old hostname
apt-general.zitzhen.cnis being deprecated and will 301-redirect toapt.zitzhen.cn. Existing sources keep working through the redirect, but everyapt-get updatepays an extra round trip, so point your sources at the new hostname (see Add this repository).
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. An entry may pin what is built with a#fragment (#tag=,#latest-tag,#branch=); without one the upstream default branch is built. See Pinning an upstream ref; - 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.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
│ ├── resolve-upstream-ref.sh # Resolves #tag=/#latest-tag/#branch= to a commit
│ ├── 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 and .deb files
│ ├── github-app-token.sh # Mints a GitHub App installation token
│ ├── generate-index.sh # Writes browsable, scheme-aware index.html files
│ ├── 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.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.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.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.zitzhen.cn/log/ # every run
https://apt.zitzhen.cn/log/2026-12-01-46640252167/ # one run
https://apt.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, the requested ref, start time, runner
and the workflow commit, and ends with the commit that was actually packaged
(
source), the finish time and the build's exit status, so a failed build is diagnosable without opening the Actions run. Therunline 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.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 and the.debpackages this run built attached as assets, so a run can be downloaded without cloning. The packages are release assets only: they are never committed to the log repository, which keeps the git history free of binaries while the binaries stay downloadable. 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. - Only the packages built by the run itself are attached, matching how the logs
are archived: a partial rebuild publishes what it rebuilt, not the packages it
left untouched in the bucket. A run whose builds all failed still produces a
release, just with logs and no
.deb. - 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; - An optional
#fragment pins what is built instead of following the default branch:#tag=v1.5.1,#latest-tagor#branch=dev(see Pinning an upstream ref); - Blank lines and lines starting with
#are ignored; an inline#preceded by whitespace starts a comment, while a#attached to the URL is the fragment; - Duplicate URLs are ignored (a warning is printed); the same URL with two different fragments is an error, since one run publishes one version;
- 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.
By default an entry follows the upstream default branch, which means a new
upstream commit — even one that does not bump debian/changelog — changes the
published package on the next run. To build something fixed instead, append a
fragment to the URL in Software.list:
https://github.com/zitzhen/patchsplit#tag=v1.5.1 # that exact tag
https://github.com/zitzhen/GitTune#latest-tag # the newest stable tag
https://github.com/zitzhen/kzhento-installer-prompt#branch=dev
https://github.com/win12-online/win12-desktop # default branch, as before
Notes:
#tag=and#branch=fail the build if the ref does not exist upstream; nothing falls back to the default branch, so a typo cannot quietly publish the wrong thing.#latest-tagis resolved when the build starts, so the package tracks upstream releases without editing the manifest. Prerelease tags (alpha,beta,rc,pre,preview,dev,devel,snapshot,canary,nightly) are skipped so a release candidate is never shipped as the stable package; pin#tag=to publish one deliberately.- The resolved commit is recorded as
sourcein the build log under/log/, so a.debcan be traced back to the exact upstream commit even when the entry tracks a moving ref.
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.