@kungfu-tech/buildchain 2.4.9-alpha.0 → 2.4.9-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,4 +62,6 @@ the PR merge ref SHA, or an exact Git tree match with the promoted channel HEAD;
62
62
  this keeps post-merge channel commits strict without forcing a rebuild. The
63
63
  Buildchain-owned promotion workflow resolves the matching same-repository
64
64
  merged channel PR and downloads its PR-stage RC passport automatically before
65
- promotion starts.
65
+ promotion starts. The consumer wrapper defaults to a PR-stage workflow file
66
+ named `build.yml` with display name `Build`, and filters the RC passport and
67
+ build summary by the configured `artifact-name` before promotion.
@@ -392,6 +392,10 @@ jobs:
392
392
  channel: alpha
393
393
  target-ref: alpha/v22/v22.22
394
394
  artifact-name: libnode
395
+ # Defaults to build.yml / Build. Override only when the PR-stage build
396
+ # workflow uses a different file or display name.
397
+ release-candidate-workflow-file: build.yml
398
+ release-candidate-workflow-name: Build
395
399
  package-manager: npm
396
400
  publish-target: npm
397
401
  runner-preset: github-hosted
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "2.4.9-alpha.0",
3
+ "version": "2.4.9-alpha.1",
4
4
  "private": false,
5
5
  "description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
6
6
  "repository": "https://github.com/kungfu-systems/buildchain",
@@ -118,16 +118,21 @@ function outputPath(filePath) {
118
118
  return relative.startsWith("../") || relative === ".." ? filePath : relative;
119
119
  }
120
120
 
121
- export function selectReleaseCandidateArtifacts({ artifacts = [] }) {
121
+ export function selectReleaseCandidateArtifacts({ artifacts = [], artifactName = "" }) {
122
+ const expectedPrefix = String(artifactName || "").trim();
122
123
  const active = artifacts.filter((artifact) => !artifact.expired);
123
- const passports = active.filter((artifact) => /-release-candidate-[0-9a-f]{40}$/i.test(artifact.name || ""));
124
+ const passports = active
125
+ .map((artifact) => {
126
+ const match = String(artifact.name || "").match(/^(.+)-release-candidate-([0-9a-f]{40})$/i);
127
+ return match ? { artifact, prefix: match[1], sourceSha: match[2] } : undefined;
128
+ })
129
+ .filter(Boolean)
130
+ .filter((candidate) => !expectedPrefix || candidate.prefix === expectedPrefix);
124
131
  if (passports.length !== 1) {
125
- throw new Error(`expected exactly one release-candidate passport artifact, found ${passports.length}`);
132
+ const scope = expectedPrefix ? ` for artifact-name ${expectedPrefix}` : "";
133
+ throw new Error(`expected exactly one release-candidate passport artifact${scope}, found ${passports.length}`);
126
134
  }
127
- const passport = passports[0];
128
- const match = passport.name.match(/^(.+)-release-candidate-([0-9a-f]{40})$/i);
129
- const prefix = match?.[1] || "";
130
- const sha = match?.[2] || "";
135
+ const { artifact: passport, prefix, sourceSha: sha } = passports[0];
131
136
  const summaries = active.filter((artifact) => artifact.name === `${prefix}-summary-${sha}`);
132
137
  if (summaries.length !== 1) {
133
138
  throw new Error(`expected exactly one build summary artifact named ${prefix}-summary-${sha}, found ${summaries.length}`);
@@ -164,6 +169,7 @@ export async function resolveReleaseCandidateArtifacts({
164
169
  apiUrl = env("GITHUB_API_URL", "https://api.github.com"),
165
170
  workflowFile = DEFAULT_WORKFLOW_FILE,
166
171
  workflowName = "Build Surface Fixture",
172
+ artifactName = "",
167
173
  outputDir = ".buildchain/release-candidate",
168
174
  fetchImpl = globalThis.fetch,
169
175
  download = true,
@@ -213,6 +219,7 @@ export async function resolveReleaseCandidateArtifacts({
213
219
  });
214
220
  const selected = selectReleaseCandidateArtifacts({
215
221
  artifacts: Array.isArray(artifactResponse.artifacts) ? artifactResponse.artifacts : [],
222
+ artifactName,
216
223
  });
217
224
  const result = {
218
225
  enabled: true,
@@ -233,6 +240,7 @@ export async function resolveReleaseCandidateArtifacts({
233
240
  artifacts: {
234
241
  passport: selected.passport.name,
235
242
  summary: selected.summary.name,
243
+ artifactName: selected.prefix,
236
244
  sourceSha: selected.sourceSha,
237
245
  },
238
246
  };
@@ -287,6 +295,7 @@ export async function resolveReleaseCandidateArtifactsCli() {
287
295
  targetSha: env("BUILDCHAIN_TARGET_SHA"),
288
296
  workflowFile: env("BUILDCHAIN_RC_WORKFLOW_FILE", DEFAULT_WORKFLOW_FILE),
289
297
  workflowName: env("BUILDCHAIN_RC_WORKFLOW_NAME", ""),
298
+ artifactName: env("BUILDCHAIN_ARTIFACT_NAME"),
290
299
  outputDir: env("BUILDCHAIN_RC_OUTPUT_DIR", ".buildchain/release-candidate"),
291
300
  });
292
301
  writeGitHubOutputs({