Release macula-rust from the forge (refs #2) #3

Manually merged
terra merged 7 commits from hygiea/2-release-on-the-forge into master 2026-11-24 03:06:57 +00:00
Member

Refs #2 (forge-setup#30 rust port). Builder: Hygiea. Reviewer: Neptunus.

Tip 499bf683 on master 78d495c. Publish token referenced as secrets.CARGO_REGISTRY_TOKEN only; release-guard and dependency-advisories as local copies; plain-shell checkout; Go 1.27.4 read from tests/teststation/go.mod with a pinned sha256; publish job in macula-ci-otp by digest.

Actions are off on this repo until this lands, so there are no runs yet. Full record on #2.

Refs #2 (forge-setup#30 rust port). Builder: Hygiea. Reviewer: Neptunus. Tip 499bf683 on master 78d495c. Publish token referenced as secrets.CARGO_REGISTRY_TOKEN only; release-guard and dependency-advisories as local copies; plain-shell checkout; Go 1.27.4 read from tests/teststation/go.mod with a pinned sha256; publish job in macula-ci-otp by digest. Actions are off on this repo until this lands, so there are no runs yet. Full record on #2.
release-core.yml (v*) and release-ffi.yml (ffi-v*) run on the forge's own
runner now: tag-triggered only, on the local host00 runner because this
repository is private.

- CARGO_REGISTRY_TOKEN replaces secrets.CRATES_IO_TOKEN: the forge repository
  secret, filled by the owner from ~/.config/forge/crates-macula-rust.token
  (macula-io/forge-setup#30 section 2). The workflow only references it.
- release-guard.yml and dependency-advisories.yml are local copies, because
  the forge calls into another repository only when that repository is public
  and macula-ci-images is not. Both are byte for byte their upstream files
  (b4c41abb and 476b5724) below their STAND-IN headers.
- checkout is the plain-shell step every forge repository carries; the Go
  toolchain is installed from the tarball tests/teststation/go.mod names,
  its sha256 pinned, because no image in the forge registry carries Go
  (the Supervisor's ruling on this issue).
- The publish job runs in the forge's macula-ci-otp image by digest, pulled
  with the org's read-only ci-image-puller account; it carries rustup, and
  rustup installs the version rust-toolchain.toml pins.
The Supervisor's ruling on how the port is proved: no tag is pushed for it.
Both release workflows take workflow_dispatch, run the same jobs, and stop
before the upload.

- The real publish step is guarded on `github.event_name == 'push'`, not on
  anything the trigger carries; workflow_dispatch declares no inputs at all,
  so no value a caller sends can reach `cargo publish`, and a dispatch started
  on a tag ref publishes nothing either because the guard reads the event.
- The two tag checks (extract the version from the tag, compare it to the
  manifest) are skipped on a dispatch: there is no tag to compare, and a
  dispatch's GITHUB_REF_NAME names a branch.
- The dry run is unconditional, so it is what a dispatch proves.

After the lander's Actions GO, one dispatch on main is the port's proof. The
first real v<version> tag goes in the release menu with the crates token.
Neptunus's R1 on PR 3: two workflows could never run on the forge, so master and
every PR would show jobs queued forever.

ci.yml: eight jobs ported to the forge — fmt, clippy, test, coverage, doc,
erlang-helper-lint, go-helper-lint and the advisories gate (a local copy of the
ci-images file at 476b5724, because the pinned 83a76a35 still checks out with
actions/checkout@v4). Plain-shell checkout and runs-on docker everywhere; the
Go toolchain from the tarball tests/teststation/go.mod names, sha256 pinned;
golangci-lint by `go install` at the version the action pinned, checked on the
module proxy. The Rust dependency cache action goes with the runner's own cache
server, which is off.

Six jobs are guarded with if: github.server_url == 'https://github.com' and
nothing is deleted: the five that need a Windows, macOS or Android runner (the
Supervisor's ruling, 2026-11-24, platforms decided with macula-ts#2's), plus
key-files-without-hard-links (runs each suite in `docker run --security-opt`,
and the forge mounts no docker socket into a job, by design) and ffi-bindings
(kotlinc needs a JDK; java and javac are absent from the image, checked in it).
Each guard sits on a runs-on job, so Forgejo reads it; the only uses: jobs left
are local copies, which expand.

sealed-interop.yml: the sealed job is guarded too. Its own actions are only
checkout and setup-go, but scripts/interop/sealed.sh starts both sides with
`podman run`, so the interop proof needs a runner with podman.

Both release files: the tag version reaches the validation script through env:,
never pasted into the command text (Neptunus's second point).
DECIDED 2026-11-24, Raf: "we will ONLY use our own package management on the
forge....no API key theatre we are sovereign" (forge-setup#30 c3130).

- .cargo/config.toml names the registry once: [registries.macula] index =
  https://git.macula.io/macula-sdk/_cargo-index, with git-fetch-with-cli for
  the git index. Third-party dependencies still come from crates.io; only
  publishing moves.
- Both release workflows publish with --registry macula, and their dry runs
  target the same registry, because a dry run that reads crates.io proves
  nothing about where the crate goes.
- The credential is the repository's own publisher account in macula-sdk,
  made by the crew's script (forge-setup#36), and reaches a job only as the
  named secret CARGO_REGISTRY_TOKEN. No crates.io token exists here.
- The FFI dry run's core-version check now names the forge registry. It is
  unverified until macula-sdk exists: a dry run against a missing index stops
  at the fetch (404, probed in the CI image).
The Supervisor's ruling on publisher accounts: ONE account for all SDKs,
sdk-publisher, a member of macula-sdk only with write:package only.

- Both release workflows take FORGE_PACKAGES_USER=sdk-publisher and the
  FORGE_PACKAGES_TOKEN secret, and no CARGO_REGISTRY_TOKEN name remains.
- The index is a git repository that answers no anonymous read, so git gets
  the account through a credential helper that reads those two variables: the
  token reaches neither ~/.cargo/credentials, nor the command line, nor the log.
- The upload takes the same token through CARGO_REGISTRIES_MACULA_TOKEN, which
  is how cargo names the token of a registry that is not crates.io.
- .cargo/config.toml records the probe: the index path relayed to us does not
  resolve with a valid member token ("Repository not found"), so that line is
  the one place to correct if Forgejo's own Cargo index path is the real one.
The dispatcher probed the registry: Forgejo serves macula-sdk's Cargo index
as a SPARSE index at /api/packages/macula-sdk/cargo/ and answers its
config.json anonymously ("auth-required": false). The git index path relayed
before does not exist.

- .cargo/config.toml names that sparse index; the [net] git-fetch-with-cli
  line goes with the git fetch it was for.
- The dry run carries no token and no credential helper: it now gets past the
  index and packages the crate. The upload keeps the token, as
  CARGO_REGISTRIES_MACULA_TOKEN (cargo's name for a registry that is not
  crates.io), and FORGE_PACKAGES_USER names the account it belongs to.

Proved in the pinned CI image on host00, no token in the environment:
`cargo publish --dry-run --registry macula` for this workspace printed
"Compiling macula-rust v0.15.1", "Finished dev profile in 1m 23s", "Uploading
macula-rust v0.15.1 (/src)" and "warning: aborting upload due to dry run".
MSg
`${ secrets.FORGE_PACKAGES_TOKEN }` (single braces) is not an expression: the runner passes it
through literally, so cargo would send that text as the token. And cargo sends the configured
token as the Authorization header verbatim, while the forge refuses a bare token (401) and
takes `Bearer <token>`. Both files, the reviewer's fix at r=2.
terra manually merged commit 39135a787a into master 2026-11-24 03:06:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 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-rust!3
No description provided.