Skip to content

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Rust

fix(ci): preserve release artifact download paths (#2319)

Florian Brand6ceb046fe059
diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml
index 2dd876e979..b382289117 100644
--- a/.github/workflows/build-binaries.yml
+++ b/.github/workflows/build-binaries.yml
@@ -315,11 +315,19 @@ jobs:
working-directory: source
run: npm ci
- - name: Download exact final release artifacts
+ - name: Download exact final production artifacts
+ if: env.PUBLISH_PRODUCTION == 'true'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
- pattern: prime-agent-*
- path: ${{ runner.temp }}/final-artifacts
+ name: prime-agent-production
+ path: ${{ runner.temp }}/final-artifacts/prime-agent-production
+
+ - name: Download exact final beta artifacts
+ if: env.PUBLISH_BETA == 'true'
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
+ with:
+ name: prime-agent-beta
+ path: ${{ runner.temp }}/final-artifacts/prime-agent-beta
- name: Download tested executable identity
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
diff --git a/packages/coding-agent/.changes/fix-release-artifact-downloads.md b/packages/coding-agent/.changes/fix-release-artifact-downloads.md
new file mode 100644
index 0000000000..3ab77509b8
--- /dev/null
+++ b/packages/coding-agent/.changes/fix-release-artifact-downloads.md
@@ -0,0 +1 @@
+- Fixed beta-only and stable-only releases failing macOS validation because their artifacts were downloaded to the wrong directory ([#2265](https://github.com/PrimeIntellect-ai/prime-agent/issues/2265)).
diff --git a/packages/coding-agent/test/release-workflow.test.ts b/packages/coding-agent/test/release-workflow.test.ts
index 140c0a55b4..8a9df9b689 100644
--- a/packages/coding-agent/test/release-workflow.test.ts
+++ b/packages/coding-agent/test/release-workflow.test.ts
@@ -1,5 +1,5 @@
import { spawnSync } from "node:child_process";
-import { mkdtempSync, readFileSync, rmSync } from "node:fs";
+import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
import { describe, expect, it } from "vitest";
@@ -88,6 +88,64 @@ describe("release workflow signature gates", () => {
for (const write of writes) expect(publish.steps.indexOf(gate)).toBeLessThan(publish.steps.indexOf(write));
});
+ it.each([{ channels: ["production"] }, { channels: ["beta"] }, { channels: ["production", "beta"] }])(
+ "finds the downloaded manifests when publishing $channels",
+ ({ channels }) => {
+ const validation = release.jobs["validate-macos"]!;
+ const directory = mkdtempSync(join(tmpdir(), "prime-release-downloads-"));
+ try {
+ mkdirSync(join(directory, "packages/coding-agent"), { recursive: true });
+ for (const channel of channels) {
+ const name = `prime-agent-${channel}`;
+ const download = validation.steps.find(
+ (entry) =>
+ entry.uses?.startsWith("actions/download-artifact@") &&
+ (entry.with?.name === name || entry.with?.pattern === "prime-agent-*"),
+ );
+ expect(download, `Missing download for ${channel}`).toBeDefined();
+ if (download!.if) expect(download!.if).toBe(`env.PUBLISH_${channel.toUpperCase()} == 'true'`);
+ // download-artifact nests pattern matches only when more than one artifact matches.
+ const destination = download!.with!.path!.replace(`\${{ runner.temp }}`, directory);
+ const path = download!.with!.name || channels.length === 1 ? destination : join(destination, name);
+ mkdirSync(path, { recursive: true });
+ writeFileSync(join(path, channel === "production" ? "latest.json" : "beta.json"), "{}");
+ writeFileSync(join(path, "prime-agent-1.2.3-darwin-arm64.tar.gz"), "");
+ }
+ const result = spawnSync(
+ "bash",
+ [
+ "-e",
+ "-o",
+ "pipefail",
+ "-c",
+ `node() { test -f "$2/latest.json" || test -f "$2/beta.json"; }
+npx() { test -f "$PRIME_AGENT_TEST_ARCHIVE"; printf '%s\\n' "$PRIME_AGENT_TEST_ARCHIVE"; }
+${step(validation, "Verify and exercise exact final Mac archives").run}`,
+ ],
+ {
+ cwd: directory,
+ env: {
+ ...process.env,
+ RUNNER_TEMP: directory,
+ TARGET_PLATFORM: "darwin-arm64",
+ PUBLISH_PRODUCTION: String(channels.includes("production")),
+ PUBLISH_BETA: String(channels.includes("beta")),
+ },
+ encoding: "utf8",
+ },
+ );
+ expect(result.status, result.stderr).toBe(0);
+ expect(result.stdout.trim().split("\n")).toEqual(
+ channels.map((channel) =>
+ join(directory, `final-artifacts/prime-agent-${channel}/prime-agent-1.2.3-darwin-arm64.tar.gz`),
+ ),
+ );
+ } finally {
+ rmSync(directory, { recursive: true, force: true });
+ }
+ },
+ );
+
it("retains all four standalone targets and only uploads tested executable identities", () => {
const build = standalone.jobs.build!;
expect(build.strategy?.matrix.include.map((entry) => entry.platform)).toEqual([