ci: fix package publishing + add dev/main packages #65

Merged
Bartender merged 2 commits from fix/package-publishing into dev 2026-06-27 14:03:01 +00:00
Owner

Root cause

.gitea/workflows/publish.yml triggered only on push: tags: v*, and the repo has zero tags. Merging to main never created a tag, so the publish workflow never ran and no package was ever built. The build/publish steps and the REGISTRY_TOKEN + github.actor credentials were already proven working by docker.yml, which pushes images to the same Gitea registry.

Changes

ci: — rewrite publish.yml to publish on merge

  • Trigger changed from v* tags to push on dev and main.
  • dev push → aegis-gitea-mcp-dev at X.Y.Z.dev<run_number> (CI run number is monotonic, so every dev build is unique).
  • main push → stable aegis-gitea-mcp at X.Y.Z. Uses uv publish --check-url, so a main push that did not bump the version is a clean no-op (already-published files are skipped) instead of a hard 409.
  • Package name + version are patched into pyproject.toml at build time only — the committed file keeps aegis-gitea-mcp / 0.2.0.
  • Lint + test gates still run before publish; REGISTRY_TOKEN is required (fail-closed) so the job never publishes anonymously.

docs: — document both channels

  • docs/packaging.md now describes the stable vs dev channels, install commands for each, that both ship the same aegis_gitea_mcp module (install one or the other per environment), and the merge-driven release flow (bump version → PR into dev → promote devmain).

Verified locally

  • uv build produces both wheel + sdist.
  • Committed pyproject.toml still parses; name/version unchanged.
  • CI sed-patch dry-run yields valid TOML.
  • publish.yml parses as YAML.
  • ruff check src tests clean; pytest green at 84% coverage (>80% gate).

Deviations

None. No astral-sh/setup-uv@v5 fallback was needed (kept as-is, consistent with docker.yml's use of third-party actions).

After merge

Merging this into dev is itself the test — it should publish aegis-gitea-mcp-dev 0.2.0.dev<run> to the Gitea package registry. Stable aegis-gitea-mcp appears once dev is promoted to main. Pre-flight: a runner with the ubuntu-latest label must be online and the REGISTRY_TOKEN secret's owning user must match github.actor on dev/main pushes.

## Root cause `.gitea/workflows/publish.yml` triggered only on `push: tags: v*`, and the repo has **zero tags**. Merging to `main` never created a tag, so the publish workflow never ran and no package was ever built. The build/publish steps and the `REGISTRY_TOKEN` + `github.actor` credentials were already proven working by `docker.yml`, which pushes images to the same Gitea registry. ## Changes **`ci:` — rewrite publish.yml to publish on merge** - Trigger changed from `v*` tags to `push` on `dev` and `main`. - `dev` push → `aegis-gitea-mcp-dev` at `X.Y.Z.dev<run_number>` (CI run number is monotonic, so every dev build is unique). - `main` push → stable `aegis-gitea-mcp` at `X.Y.Z`. Uses `uv publish --check-url`, so a `main` push that did **not** bump the version is a clean no-op (already-published files are skipped) instead of a hard 409. - Package name + version are patched into `pyproject.toml` **at build time only** — the committed file keeps `aegis-gitea-mcp` / `0.2.0`. - Lint + test gates still run before publish; `REGISTRY_TOKEN` is required (fail-closed) so the job never publishes anonymously. **`docs:` — document both channels** - `docs/packaging.md` now describes the stable vs dev channels, install commands for each, that both ship the same `aegis_gitea_mcp` module (install one or the other per environment), and the merge-driven release flow (bump version → PR into `dev` → promote `dev` → `main`). ## Verified locally - `uv build` produces both wheel + sdist. - Committed `pyproject.toml` still parses; name/version unchanged. - CI sed-patch dry-run yields valid TOML. - `publish.yml` parses as YAML. - `ruff check src tests` clean; `pytest` green at 84% coverage (>80% gate). ## Deviations None. No `astral-sh/setup-uv@v5` fallback was needed (kept as-is, consistent with docker.yml's use of third-party actions). ## After merge Merging this into `dev` is itself the test — it should publish `aegis-gitea-mcp-dev 0.2.0.dev<run>` to the Gitea package registry. Stable `aegis-gitea-mcp` appears once `dev` is promoted to `main`. Pre-flight: a runner with the `ubuntu-latest` label must be online and the `REGISTRY_TOKEN` secret's owning user must match `github.actor` on dev/main pushes.
Bartender added 2 commits 2026-06-27 14:02:10 +00:00
Replace the tag-only publish trigger (no v* tags ever existed, so the
package was never built) with branch-push publishing:

- dev push  -> aegis-gitea-mcp-dev at X.Y.Z.dev<run_number> (always unique)
- main push -> aegis-gitea-mcp at X.Y.Z, a clean no-op via uv --check-url
  if that version is already in the registry

Name + version are patched into pyproject.toml at build time only; the
committed file keeps aegis-gitea-mcp / X.Y.Z. Lint + test gates still run
before publish, and the REGISTRY_TOKEN secret is required (fail-closed).
docs: document dev and stable package channels
docker / test (push) Successful in 36s
docker / lint (push) Successful in 41s
lint / lint (push) Successful in 44s
docker / test (pull_request) Successful in 37s
lint / lint (pull_request) Successful in 44s
test / test (push) Successful in 45s
docker / lint (pull_request) Successful in 42s
test / package (push) Successful in 1m6s
test / test (pull_request) Successful in 40s
test / package (pull_request) Successful in 57s
docker / docker (pull_request) Successful in 56s
docker / docker (push) Successful in 1m7s
45641f8e2c
Document the two publish channels (aegis-gitea-mcp from main,
aegis-gitea-mcp-dev from dev), install commands for each, that both share
the aegis_gitea_mcp module so only one installs per environment, and the
merge-driven stable release flow (bump version -> PR into dev -> promote
dev to main; re-pushing main at the same version is a --check-url no-op).
Bartender added the Kind/ChoreKind/DocumentationPriority/Medium labels 2026-06-27 14:02:19 +00:00
Bartender merged commit 64611d9c53 into dev 2026-06-27 14:03:01 +00:00
Sign in to join this conversation.