Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 3.27 KB

develop.md

File metadata and controls

74 lines (53 loc) · 3.27 KB

Development and Packaging

← Back to documentation index

For developers. Regular users should start at the documentation index.

Layout

.
├── src/                  # module sources (mapped to the ZIP root when packing)
│   ├── bin/              # AdGuardHome.yaml and other runtime files
│   ├── scripts/          # tool.sh / iptables.sh / inotify.sh / debug.sh / base.sh
│   ├── webroot/          # module web UI
│   ├── customize.sh      # installer (keep/backup logic for config files)
│   ├── service.sh        # boot service
│   ├── action.sh         # root manager action button
│   ├── uninstall.sh      # uninstaller
│   ├── settings.conf     # module configuration
│   ├── module.prop       # module metadata
│   └── META-INF/         # installer
├── docs/                 # user documentation (index.md is the entry, zh/ and en/ hold each language)
├── cache/                # packaging cache and output (git-ignored)
├── pack.ps1              # Windows packaging script
├── pack.sh               # Linux / macOS / CI packaging script
├── version.json          # version and update information
└── changelog.md          # current release notes (also used as the Release body)

Local packaging

pack.ps1 (Windows) and pack.sh (Linux / macOS / CI) do the same thing: download and cache the latest AdGuardHome, then pack it together with src/ into a module ZIP. CI reuses pack.sh.

Windows (requires 7-Zip; the script calls C:\Program Files\7-Zip\7z.exe):

.\pack.ps1

Linux / macOS (requires curl or wget, tar, and one of zip, 7z/7za, python3):

./pack.sh          # pack arm64 + armv7
./pack.sh arm64    # pack arm64 only
./pack.sh armv7    # pack armv7 only

The script then automatically:

  1. Creates the cache directory if needed.
  2. Downloads and caches the latest AdGuardHome (skipped when the cache already has it).
  3. Packs AdGuardHome and the contents of src/ into a ZIP (cache/AdGuardHomeForRoot_<arch>.zip).

The resulting ZIP mirrors the layout of src/, with the AdGuardHome binary at bin/AdGuardHome. Because AdGuardHome is cached, repeated runs do not download it again.

CI and releases

Pushing a tag in the form YYYYMMDD triggers pack.yml, which only publishes releases:

  1. Validates that the tag is an 8-digit date (YYYYMMDD)
  2. Runs pack.sh all to build both architectures
  3. Creates a GitHub Release whose body comes from changelog.md and whose assets are the two ZIPs in cache/

The workflow can also be run manually, in which case it only verifies packaging and produces nothing downloadable. No build artifacts are uploaded to Actions: installable module ZIPs come only from Releases, use pack.sh for local builds.

Before releasing, update:

  • version.json: increment versionCode, set version to YYYYMMDD
  • src/module.prop: version and versionCode
  • changelog.md: keep only the current release changes, one Chinese and one English entry

Commit style

The repository uses Conventional Commits. Common prefixes: feat, fix, docs, chore, ci, refactor.