|
| 1 | +# Repository Guidelines (English) |
| 2 | + |
| 3 | +[中文版本](guidelines.zh.md) |
| 4 | + |
| 5 | +## Project Structure & Module Organization |
| 6 | +This repository automates Arch User Repository maintenance: it monitors upstream releases, rebuilds packages, and publishes to AUR. GitHub Actions workflows reside in `.github/workflows/`—`monitor-upstream.yml` handles scheduled detection, while `release.yml` publishes successful builds. Shared tooling lives in `scripts/`; orchestration happens in `update-package.sh`, and reusable helpers will be added under `scripts/lib/`. Each package stores its materials in `pkgs/<pkgname>/`, including `PKGBUILD`, `.SRCINFO`, and a package-specific `upstream.sh`. |
| 7 | + |
| 8 | +## Build, Test, and Development Commands |
| 9 | +Activate any project toolchain via `source scripts/env.sh` (when available) and run scripts with `./scripts/<name>.sh`. Typical local checks: |
| 10 | +- `scripts/update-package.sh kdenlive-appimage-pure` – detect upstream releases, refresh PKGBUILD and `.SRCINFO`. |
| 11 | +- `makepkg --syncdeps --cleanbuild` – reproducible local build. |
| 12 | +- `namcap PKGBUILD` & `namcap *.pkg.tar.zst` – static quality checks. |
| 13 | +- `extra-x86_64-build` – clean-chroot validation mirroring the AUR toolchain. |
| 14 | + |
| 15 | +## Coding Style & Naming Conventions |
| 16 | +Shell scripts target Bash, begin with `set -euo pipefail`, and use two-space indentation. Python helpers (when present) should follow `black` and `isort` defaults and export type hints on public functions. Name directories with lowercase-kebab style; shell files mirror that convention, while Python modules use snake_case. Reuse shared logging utilities under `scripts/lib/` to keep CI output consistent. |
| 17 | + |
| 18 | +## Testing Guidelines |
| 19 | +Execute `makepkg --syncdeps --cleanbuild` before publishing, and ensure `namcap` passes with no critical findings. Add regression coverage whenever you fix a bug; automation scripts should ship with minimal bats/shunit2 tests where feasible. CI jobs must build within a clean chroot, run QA, and upload artifacts plus logs for review. |
| 20 | + |
| 21 | +## Commit & Pull Request Guidelines |
| 22 | +Adopt Conventional Commits (`feat:`, `fix:`, `ci:`). Include upstream version bumps in commit subjects (e.g., `fix: bump kdenlive to 25.08.2`). Pull requests must update both `PKGBUILD` and `.SRCINFO`, attach CI logs, and link upstream releases or issues. Ensure GitHub Actions workflows succeed before requesting review. |
| 23 | + |
| 24 | +## Security & Configuration Tips |
| 25 | +Store AUR SSH keys and tokens inside repository secrets (e.g., `AUR_SSH_KEY`, `AUR_GIT_URL`) and rotate them quarterly. Never print secrets in scripts—use environment files or GitHub Actions secrets. Document any new credentials in `docs/secrets.md`, including rotation steps, so maintainers can audit quickly. |
0 commit comments