Release: a job tells Packagist after the tag reaches the mirror #3

Manually merged
terra merged 8 commits from pallas/2-forge-release into main 2026-11-24 02:41:50 +00:00
Member

Purpose (infrastructure)

A tag pushed to git.macula.io reaches Packagist without GitHub, so composer require macula-io/macula-php keeps resolving new releases (macula-php#2). Refs macula-io/forge-setup#30, section 4 step 1; DECIDED 2026-11-24 "Yes, token plan (Recommended)". The release job follows the Supervisor's ruling that replaced the webhook, and its later ruling that the proof needs no tag.

What changed

  • .github/workflows/release.yml (new), on a v* tag and on workflow_dispatch:

    1. waits, bounded to five minutes, for the mirror to carry the release — the tag on a push, the dispatched commit on a dispatch — and fails plainly saying what it waited for;
    2. on a tag push only, POSTs {"repository":{"url":"https://packagist.org/packages/macula-io/macula-php"}} to https://packagist.org/api/update-package?username=beamologist&apiToken=<secret>, with PACKAGIST_TOKEN from the repository secret. The URL reaches curl as a config on stdin, so the token is never on a command line; no set -x, no curl -v, and no message echoes it; a refusal prints Packagist's answer into the run log, token masked.

    A dispatch therefore rehearses the job and stops before the Packagist call: that step is gated on github.event_name == 'push', never on an input.

  • .github/actionlint.yaml (new): declares docker, the label the forge's runner serves, so actionlint accepts the ported job.

  • RELEASING.md (new): how a release is cut, the rehearsal, the one-time setup (repository URL, token file, the PACKAGIST_TOKEN secret, Actions on), and the runbook line for the step that waits on the token.

  • .github/workflows/ci.yml: every job runs on the forge (runs-on: docker, plain-shell checkout, the forge image by digest); the two cross-repository jobs are out, with the reason where they were.

  • README.md: the dead GitHub CI badge is gone, and a short Releases section points at the mirror and at RELEASING.md.

The job runs on the forge's runner: runs-on: docker with the house OTP image at the same pin ci.yml's check job uses.

Proof

The plain-shell checkout step, extracted from ci.yml and run against the real forge for 15b9dfa: rc=0, that commit checked out and logged. The rest, from the workflows' own run: blocks, extracted verbatim from the YAML:

  • push, tag the mirror has (v0.11.0): the mirror carries tag v0.11.0, exit 0;
  • push, tag it lacks (WAIT_SECONDS=1): ::error::tag v0.0.0-nope did not reach https://pushin.eu/macula-io/macula-php within 1s, exit 1;
  • dispatch, commit the mirror has (15b9dfa): the mirror carries commit 15b9dfa…, exit 0;
  • dispatch, commit it lacks: the same bound fails naming the commit;
  • Packagist step with the secret unset: ::error::PACKAGIST_TOKEN is not set on this repository, exit 1;
  • Packagist step with a sentinel token: Packagist answered 403, the job fails, and the masked answer is printed. Tracing the step with strace -e trace=execve found the sentinel in zero execve arguments, with a positive control seen once — the token never reaches a command line.

actionlint is clean on the workflow. No PHP changed. Forge Actions are off for this repository until its port lands, so there is no run to cite.

What is not proven here

The dispatch itself and the first real tag: both wait on the owner's ~/.config/forge/packagist.token, an admin storing it as PACKAGIST_TOKEN with Actions on, and the lander's dispatch — the runbook line in RELEASING.md.

Two open points from the port, both blocked outside this repository and named on macula-php#2:

  • docs and advisories are out of ci.yml: their target, macula-ci-images, is private on the forge, and Forgejo 15 ignores the if: of a uses: job that fails to expand, so no cross-repository call may remain. Back either by making that repository public or by standing the two files in, as the ported mcl-* repositories do.
  • php-test cannot go green until composer build can fetch libmacula from something other than GitHub's releases — the macula-go port.

There is no macOS, Windows or android job in this repository, so the GitHub-only guard has nothing to apply to.

## Purpose (infrastructure) A tag pushed to git.macula.io reaches Packagist without GitHub, so `composer require macula-io/macula-php` keeps resolving new releases (macula-php#2). Refs macula-io/forge-setup#30, section 4 step 1; DECIDED 2026-11-24 "Yes, token plan (Recommended)". The release job follows the Supervisor's ruling that replaced the webhook, and its later ruling that the proof needs no tag. ## What changed - `.github/workflows/release.yml` (new), on a `v*` tag and on `workflow_dispatch`: 1. waits, bounded to five minutes, for the mirror to carry the release — the tag on a push, the dispatched commit on a dispatch — and fails plainly saying what it waited for; 2. on a tag push only, POSTs `{"repository":{"url":"https://packagist.org/packages/macula-io/macula-php"}}` to `https://packagist.org/api/update-package?username=beamologist&apiToken=<secret>`, with `PACKAGIST_TOKEN` from the repository secret. The URL reaches curl as a config on stdin, so the token is never on a command line; no `set -x`, no `curl -v`, and no message echoes it; a refusal prints Packagist's answer into the run log, token masked. A dispatch therefore rehearses the job and stops before the Packagist call: that step is gated on `github.event_name == 'push'`, never on an input. - `.github/actionlint.yaml` (new): declares `docker`, the label the forge's runner serves, so actionlint accepts the ported job. - `RELEASING.md` (new): how a release is cut, the rehearsal, the one-time setup (repository URL, token file, the `PACKAGIST_TOKEN` secret, Actions on), and the runbook line for the step that waits on the token. - `.github/workflows/ci.yml`: every job runs on the forge (`runs-on: docker`, plain-shell checkout, the forge image by digest); the two cross-repository jobs are out, with the reason where they were. - `README.md`: the dead GitHub CI badge is gone, and a short Releases section points at the mirror and at `RELEASING.md`. The job runs on the forge's runner: `runs-on: docker` with the house OTP image at the same pin `ci.yml`'s check job uses. ## Proof The plain-shell checkout step, extracted from `ci.yml` and run against the real forge for `15b9dfa`: rc=0, that commit checked out and logged. The rest, from the workflows' own `run:` blocks, extracted verbatim from the YAML: - push, tag the mirror has (`v0.11.0`): `the mirror carries tag v0.11.0`, exit 0; - push, tag it lacks (`WAIT_SECONDS=1`): `::error::tag v0.0.0-nope did not reach https://pushin.eu/macula-io/macula-php within 1s`, exit 1; - dispatch, commit the mirror has (`15b9dfa`): `the mirror carries commit 15b9dfa…`, exit 0; - dispatch, commit it lacks: the same bound fails naming the commit; - Packagist step with the secret unset: `::error::PACKAGIST_TOKEN is not set on this repository`, exit 1; - Packagist step with a sentinel token: `Packagist answered 403`, the job fails, and the masked answer is printed. Tracing the step with `strace -e trace=execve` found the sentinel in **zero** execve arguments, with a positive control seen once — the token never reaches a command line. `actionlint` is clean on the workflow. No PHP changed. Forge Actions are off for this repository until its port lands, so there is no run to cite. ## What is not proven here The dispatch itself and the first real tag: both wait on the owner's `~/.config/forge/packagist.token`, an admin storing it as `PACKAGIST_TOKEN` with Actions on, and the lander's dispatch — the runbook line in `RELEASING.md`. Two open points from the port, both blocked outside this repository and named on macula-php#2: - `docs` and `advisories` are out of `ci.yml`: their target, macula-ci-images, is private on the forge, and Forgejo 15 ignores the `if:` of a `uses:` job that fails to expand, so no cross-repository call may remain. Back either by making that repository public or by standing the two files in, as the ported mcl-* repositories do. - `php-test` cannot go green until `composer build` can fetch libmacula from something other than GitHub's releases — the macula-go port. There is no macOS, Windows or android job in this repository, so the GitHub-only guard has nothing to apply to.
GitHub is stopped, so Packagist's repository URL for this package moves to the
public mirror https://pushin.eu/macula-io/macula-php (an owner step,
macula-io/forge-setup#30 section 2 step 5), and a Packagist-type webhook on
this repository tells Packagist about a tag instead of leaving it to the
weekly crawl.

RELEASING.md records the path, the three webhook fields and the runbook line
for the step that waits on ~/.config/forge/packagist.token. The verifier reads
the hook back as an admin and prints it with the API token masked.

The README's GitHub CI badge is gone: it pointed at a workflow that cannot run.
The webhook path is dropped: a repository webhook's packagist type can only be
built from the web form here, and the ruling is a release job that calls
Packagist itself.

release.yml runs on a v* tag. It waits, bounded to five minutes, for the tag to
reach the pushin.eu mirror, failing with the tag and the mirror it waited for;
then it POSTs to packagist.org/api/update-package with the package's page URL,
taking PACKAGIST_TOKEN from the repository secret and never printing it: no
set -x, no curl -v, and no message echoes the URL that carries it.

RELEASING.md describes the job step, the secret and the runbook line; the
verifier script for the webhook goes.
pallas changed title from Release path: Packagist reads the mirror, and a webhook serves a tag at once to Release: a job tells Packagist after the tag reaches the mirror 2026-11-24 02:23:14 +00:00
The answer went to /tmp inside the job's container, which is gone with it.
Print it into the log where it survives, with the token substituted out.
curl took the URL with the token as an argument, and the refusal mask was a
sed whose script held the token: both visible in ps to any user on the runner
host, and the sed broke on a token holding / or a regex character. The URL now
reaches curl as a config on stdin from the shell's printf, and awk masks by
index() with the token read from ENVIRON. The image comment no longer claims
ci.yml's pin, which differs.
The Supervisor's proof needs no tag: release.yml also runs on workflow_dispatch.
A dispatch waits for the mirror to carry the commit it was dispatched on, then
the run stops there. The Packagist step is gated on the event being a tag push,
never on an input, so nothing a dispatch carries can reach the POST.

The job is ported to the forge's runner: `runs-on: docker` (the label the forge
serves; a GitHub label would wait forever there) and the house OTP image at the
same pin ci.yml's check job uses. `.github/actionlint.yaml` tells actionlint the
`docker` label exists, as the ported mcl-* repositories do.
The Supervisor's port ruling, folded in before Actions go on: `runs-on: docker`
(a GitHub label would sit waiting forever on the forge), the house OTP image
from the FORGE's registry by digest — ghcr was my earlier error — and a
plain-shell checkout everywhere, since the image carries no node for a
marketplace action.

php-test installs PHP 8.4, Composer and Go from the distribution, because no
forge image carries them; Go fetches the toolchain macula-go's go.mod asks for
through GOTOOLCHAIN=auto. It is honest about the port's next blocker: composer
build takes libmacula from macula-go's GitHub releases, which are stopped, so
that step fails until the port serves it from the forge.

The two cross-repository jobs (docs, advisories) are out: their target,
macula-ci-images, is private on the forge, and Forgejo 15 ignores the `if:` of a
`uses:` job that fails to expand, so no such call may stay. The comment where
they were names the two ways back.
Dropping them would have dropped a security check. macula-ci-images is private on
the forge, so its two workflows cannot be called across repositories there; they
are copied in byte for byte below a STAND-IN header at 476b5724 — the commit the
rust port carries, whose actions are named by full URL because the forge's
default action source holds no setup-php — and called locally.

Both run without a container, on the runner's own image: that is each reusable's
toolchain-installing branch, and the shape macula-rust's port uses.
git.macula.io's registry answers an anonymous manifest pull of
macula-io/macula-ci-otp@sha256:3e202cf7 with 401, so all three container jobs
would die at the pull the day Actions go on (as mcl-mail PR 7 did). Each now
names vars.CI_IMAGE_PULL_USER / secrets.CI_IMAGE_PULL_TOKEN, which macula-io
holds, as the portal's port does.
terra manually merged commit fb504b9ec3 into main 2026-11-24 02:41:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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!3
No description provided.