Release: publish to the forge's Composer registry, not Packagist (macula-php#2) #4

Manually merged
terra merged 1 commit from pallas/2-composer-registry into main 2026-11-24 02:54:57 +00:00
Member

Refs macula-io/macula-php#2. DECIDED 2026-11-24 "we will ONLY use our own package management on the forge....no API key theatre we are sovereign".

What changes. The tag's release job no longer tells Packagist: it zips the tagged tree and PUTs it to the forge's own Composer registry, /api/packages/macula-sdk/composer, with the tag's number as ?version=. Authentication is the repository's forge publisher account, vars.FORGE_PACKAGES_USER / secrets.FORGE_PACKAGES_TOKEN, passed to curl as a config on stdin — never on a command line, never in a URL, never printed. After a 201 the job reads the registry's own p2 metadata back with no credentials and fails if the version is not in it, so a version only an uploader could see is not a publish.

What is removed. The Packagist call, the PACKAGIST_TOKEN secret, and the mirror wait — the upload needs no mirror. RELEASING.md and the README now name the registry a consumer adds (https://git.macula.io/api/packages/macula-sdk/composer), and ci.yml's two gate comments follow the same change.

A dispatch still cannot publish. The upload step is gated on the event being a tag push, never on an input; the dispatch builds the archive and stops.

Proven locally, verbatim from the file's own step text:

  • the archive step on a copy of the tree: composer.json at the root, no .git entry, 125 entries, sha256 printed; a tag that names no x.y.z and a tree with no composer.json each refuse.
  • the upload against a stand-in that records what it receives: PUT /api/packages/macula-sdk/composer?version=0.32.0, basic user ci-publisher, body 327,955 bytes whose sha256 equals the archive the step built, then a GET of the p2 metadata carrying no Authorization header — the branch a consumer takes.
  • the guards refuse before any network: another forge, another owner, a missing variable or secret.
  • a 409 prints the registry's answer and exits non-zero.
  • strace -f -e trace=execve: the token in zero argv; the positive control is the real curl … -K - --upload-file.

Still unproven, and named: the publish itself waits for the macula-sdk org (macula-io/forge-setup#36) and a publisher account that may write packages in it; the dispatch proof needs Actions on. The p2 shape was not captured from a live package — no Composer package exists on this forge yet — so the read-back grep is whitespace-tolerant and looks only for the version it uploaded.

🤖 Generated with Claude Code

Refs macula-io/macula-php#2. DECIDED 2026-11-24 "we will ONLY use our own package management on the forge....no API key theatre we are sovereign". **What changes.** The tag's `release` job no longer tells Packagist: it zips the tagged tree and PUTs it to the forge's own Composer registry, `/api/packages/macula-sdk/composer`, with the tag's number as `?version=`. Authentication is the repository's forge publisher account, `vars.FORGE_PACKAGES_USER` / `secrets.FORGE_PACKAGES_TOKEN`, passed to curl as a config on stdin — never on a command line, never in a URL, never printed. After a `201` the job reads the registry's own `p2` metadata back **with no credentials** and fails if the version is not in it, so a version only an uploader could see is not a publish. **What is removed.** The Packagist call, the `PACKAGIST_TOKEN` secret, and the mirror wait — the upload needs no mirror. `RELEASING.md` and the README now name the registry a consumer adds (`https://git.macula.io/api/packages/macula-sdk/composer`), and `ci.yml`'s two gate comments follow the same change. **A dispatch still cannot publish.** The upload step is gated on the event being a tag push, never on an input; the dispatch builds the archive and stops. **Proven locally, verbatim from the file's own step text:** - the archive step on a copy of the tree: `composer.json` at the root, no `.git` entry, 125 entries, sha256 printed; a tag that names no `x.y.z` and a tree with no `composer.json` each refuse. - the upload against a stand-in that records what it receives: `PUT /api/packages/macula-sdk/composer?version=0.32.0`, basic user `ci-publisher`, body 327,955 bytes whose sha256 equals the archive the step built, then a `GET` of the `p2` metadata carrying **no** `Authorization` header — the branch a consumer takes. - the guards refuse before any network: another forge, another owner, a missing variable or secret. - a `409` prints the registry's answer and exits non-zero. - `strace -f -e trace=execve`: the token in **zero** argv; the positive control is the real `curl … -K - --upload-file`. **Still unproven, and named:** the publish itself waits for the `macula-sdk` org (macula-io/forge-setup#36) and a publisher account that may write packages in it; the dispatch proof needs Actions on. The `p2` shape was not captured from a live package — no Composer package exists on this forge yet — so the read-back grep is whitespace-tolerant and looks only for the version it uploaded. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DECIDED 2026-11-24 "we will ONLY use our own package management on the forge....
no API key theatre we are sovereign". The tag's job zips the tagged tree and PUTs
it to /api/packages/macula-sdk/composer with the tag as ?version=, authenticated
as the repository's forge publisher account (FORGE_PACKAGES_USER /
FORGE_PACKAGES_TOKEN via a curl config on stdin, never on argv). After a 201 it
reads the registry's own p2 metadata back with no credentials and fails if the
version is not there.

The Packagist call, its token and the mirror wait are gone: the upload needs no
mirror. A dispatch still proves the job and stops before the upload, which is
gated on the event, not an input. RELEASING.md and the README name the registry
a consumer adds; ci.yml's two gate comments follow the same change.
terra manually merged commit f062585d17 into main 2026-11-24 02:54:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-io/macula-php!4
No description provided.