docs: document Gitea package registry client config and CI/CD workflow
Build and Publish Release / Build Packages and Publish (push) Successful in 26s
Build and Publish Release / Build Packages and Publish (push) Successful in 26s
This commit is contained in:
1 parent
8bec4ed932
commit
97c6ac2ab9
3 files changed
+91
-3
No files matched your search
@@ -154,3 +154,41 @@ Generated artifacts:
|
||||
- `dist/linux-updater-2.0.0.tar.gz`: Standalone distribution archive containing `install.sh`.
|
||||
- `dist/linux-updater_2.0.0_all.deb`: Native Debian/Ubuntu binary package.
|
||||
- `dist/rpm/RPMS/noarch/linux-updater-2.0.0-1.*.noarch.rpm`: Native RPM package.
|
||||
|
||||
---
|
||||
|
||||
## 6. CI/CD Pipeline & Automated Release Workflow (Gitea Actions)
|
||||
|
||||
`linux-updater` incorporates an automated CI/CD pipeline defined in `.gitea/workflows/release.yml`.
|
||||
|
||||
### A. Pipeline Architecture & Execution Environment
|
||||
- **Runner Host:** VM `giteaworker` on Synology NAS (`192.168.11.2`), running Fedora with `act_runner` in `hostexecutor` mode.
|
||||
- **Workflow Tag:** `runs-on: fedora`.
|
||||
- **Triggers:**
|
||||
- Pushing any semantic version tag matching `v*` (e.g. `v2.0.0`).
|
||||
- Manual execution via Gitea Web UI or `tea` CLI (`workflow_dispatch`).
|
||||
|
||||
### B. Pipeline Stages
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["Push Tag v* / Dispatch"] --> B["Checkout & Verify Environment (rpmbuild, python3)"]
|
||||
B --> C["Run Unit Test Suite (python3 -m unittest discover tests)"]
|
||||
C --> D["Build Distribution Packages (build_packages.py)"]
|
||||
D --> E["Upload to Gitea Package Registry (RPM & Debian)"]
|
||||
D --> F["Attach Artifacts to Gitea Release (API /releases)"]
|
||||
E --> G["Link Packages to Repository (API /packages/.../link)"]
|
||||
```
|
||||
|
||||
1. **Environment Verification:** Verifies Python 3 runtime and ensures `rpmbuild` is installed on the runner.
|
||||
2. **Quality Gate:** Runs full unit test suite (`python3 -m unittest discover tests`). Any test regression immediately aborts the pipeline.
|
||||
3. **Package Compilation:** Invokes `packaging/build_packages.py` to produce native `.deb`, `.rpm`, and `.tar.gz` packages in `dist/`.
|
||||
4. **Publishing to Gitea Package Registry:**
|
||||
- RPM: `PUT /api/packages/soda64/rpm/upload`
|
||||
- Debian: `PUT /api/packages/soda64/debian/pool/stable/main/upload`
|
||||
- Links the uploaded packages to the `linux-updater` repository via `POST /api/v1/packages/soda64/<type>/linux-updater/-/link/linux-updater`.
|
||||
- **Secret Requirement:** The upload requires a personal access token with `package:write` scope stored in repository secrets as `PACKAGES_GENERATION`.
|
||||
5. **Gitea Release & Asset Attachment:**
|
||||
- Queries or creates the Gitea Release corresponding to tag `vX.Y.Z`.
|
||||
- Idempotently purges older assets on re-runs to prevent duplicated attachments.
|
||||
- Uploads binary artifacts (`.tar.gz`, `.deb`, `.rpm`) as downloadable Release Assets for operators.
|
||||
Reference in new issue
Block a user