ci(release): Sign and publish takes the agent's files from Forgejo's own address, and Wine installs while they build #57

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:ci/release-faster into main 2026-11-16 11:31:26 +00:00
Owner

Why

An agent nightly spends more time waiting than building. In run #162, Sign and publish took 1 min 58 s, and 26 s of that was the download of the agent's artifact (~190 MB; the launcher's same step took 79 s) through Forgejo's public address behind Cloudflare: out over the home uplink and back in. The build job also installs Wine (~20 s) only after package.sh has finished.

What changed

  • agent/scripts/release.py artifacts <folder> --run <run id> <name>... (as Longshot's, MagicBeanDev/Longshot#1110): it fetches the run's named artifacts from FORGEJO_UPLOAD_API (Forgejo's own address on the quick runner's network, where artifacts are on its disk) and unpacks them. It refuses a missing or duplicated name and any entry that is not a plain file name, and writes nothing until every artifact is fetched.
  • release-agent.yml, Sign and publish: a new first step uses it. The download-artifact steps run only if it failed (the fallback, with its retry).
  • release-agent.yml, build job: Wine (installed in the background) starts the same apt commands detached, before package.sh. The Windows program starts waits for its status (10 min cap) and shows the apt log on failure.
  • agent/tests/test_release.py: the unpacking (unpacked) checked offline: plain names taken, a folder, a shared name or a non-zip refused.

Measurements

Verdict: expected to save ~45 s per agent release (~25 s in Sign and publish, more when Cloudflare is as slow as on the launcher's runs; ~20 s in the build job). The real number comes from the first nightly after merge, since the internal address can't be reached from my PC.

Testing

Tested: agent/scripts/release.py artifacts against run 30104's real artifact (Linux, public address): the three files unpacked by name. The background-install pattern in a local shell. The workflow parses (PyYAML).

Tested (Longshot's copy): the same command against a real run's artifacts (Linux, public address): unpacked by name, and a missing name refused. The background-install pattern in a local shell: the first step returns at once and the status passes through. The workflow parses (PyYAML).

Not tested: agent/tests/test_release.py (left to CI). Whether the job token may read the artifacts API: if it can't, the fallback runs as today.

Must be tested: the first nightly after merge: The agent's files, from Forgejo's own address passes, and the download-artifact steps are skipped.

Risks

If the artifacts API refuses the job token or answers differently, the release goes through the old download-artifact path. Revert the commit to undo. Nothing changes for players.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8dzkpXRZ2cBAf7vu5YQ

## Why An agent nightly spends more time waiting than building. In run [#162](https://git.magicbean.dev/MagicBeanDev/Beanstalk/actions/runs/162), *Sign and publish* took 1 min 58 s, and 26 s of that was the download of the agent's artifact (~190 MB; the launcher's same step took 79 s) through Forgejo's public address behind Cloudflare: out over the home uplink and back in. The build job also installs Wine (~20 s) only after `package.sh` has finished. ## What changed - `agent/scripts/release.py artifacts <folder> --run <run id> <name>...` (as Longshot's, [MagicBeanDev/Longshot#1110](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1110)): it fetches the run's named artifacts from `FORGEJO_UPLOAD_API` (Forgejo's own address on the quick runner's network, where artifacts are on its disk) and unpacks them. It refuses a missing or duplicated name and any entry that is not a plain file name, and writes nothing until every artifact is fetched. - `release-agent.yml`, *Sign and publish*: a new first step uses it. The `download-artifact` steps run only if it failed (the fallback, with its retry). - `release-agent.yml`, build job: *Wine (installed in the background)* starts the same apt commands detached, before `package.sh`. *The Windows program starts* waits for its status (10 min cap) and shows the apt log on failure. - `agent/tests/test_release.py`: the unpacking (`unpacked`) checked offline: plain names taken, a folder, a shared name or a non-zip refused. ## Measurements **Verdict:** expected to save ~45 s per agent release (~25 s in *Sign and publish*, more when Cloudflare is as slow as on the launcher's runs; ~20 s in the build job). The real number comes from the first nightly after merge, since the internal address can't be reached from my PC. ## Testing **Tested:** `agent/scripts/release.py artifacts` against run 30104's real artifact (Linux, public address): the three files unpacked by name. The background-install pattern in a local shell. The workflow parses (PyYAML). **Tested (Longshot's copy):** the same command against a real run's artifacts (Linux, public address): unpacked by name, and a missing name refused. The background-install pattern in a local shell: the first step returns at once and the status passes through. The workflow parses (PyYAML). **Not tested:** `agent/tests/test_release.py` (left to CI). Whether the job token may read the artifacts API: if it can't, the fallback runs as today. **Must be tested:** the first nightly after merge: *The agent's files, from Forgejo's own address* passes, and the download-artifact steps are skipped. ## Risks If the artifacts API refuses the job token or answers differently, the release goes through the old download-artifact path. Revert the commit to undo. Nothing changes for players. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8dzkpXRZ2cBAf7vu5YQ
ci(release): Sign and publish takes the agent's files from Forgejo's own address, and Wine installs while they build
Some checks are pending
CI / Coordinator tests (pull_request) Waiting to run
CI / Agent build and checks (pull_request) Waiting to run
CI / Coordinator image (pull_request) Waiting to run
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 4s
451162f60a
Sign and publish fetched the agent's files through Forgejo's public address behind Cloudflare (26 s of its 118 in run 162;
the launcher's same step took 79 s). agent/scripts/release.py artifacts fetches the run's artifact from RELEASE_UPLOAD_API,
the address on the quick runner's network, where it is on Forgejo's disk; download-artifact stays as the fallback.

The build job installed Wine after package.sh: it now installs in the background while package.sh builds, and the
--self-check step waits for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dzkpXRZ2cBAf7vu5YQ
HumanBean changed title from WIP: ci(release): Sign and publish takes the agent's files from Forgejo's own address, and Wine installs while they build to ci(release): Sign and publish takes the agent's files from Forgejo's own address, and Wine installs while they build 2026-11-16 11:31:23 +00:00
Sign in to join this conversation.
No reviewers
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
MagicBeanDev/Beanstalk!57
No description provided.