Skip to content

Add release build output dispatch action - #134

Open
msarahan wants to merge 1 commit into
rapidsai:mainfrom
msarahan:agent/release-build-output-dispatch
Open

Add release build output dispatch action#134
msarahan wants to merge 1 commit into
rapidsai:mainfrom
msarahan:agent/release-build-output-dispatch

Conversation

@msarahan

@msarahan msarahan commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What is this?

This is the reusable action that creates manifests for the artifacts produced by our open source builds. This is part of a plan for:

The implementation here follows our existing dispatch pattern, rather than earlier efforts that basically did the same thing on shared-workflows (rapidsai/shared-workflows#609)

@msarahan msarahan added DO NOT MERGE Development or canary PR; do not merge feature request New feature or request non-breaking Introduces a non-breaking change labels Aug 4, 2026
@msarahan msarahan changed the title [DO NOT MERGE] Add release build output dispatch action Add release build output dispatch action Aug 4, 2026
@msarahan msarahan removed the DO NOT MERGE Development or canary PR; do not merge label Aug 4, 2026
@msarahan
msarahan marked this pull request as ready for review August 4, 2026 15:27
@msarahan
msarahan requested a review from a team as a code owner August 4, 2026 15:27
@msarahan
msarahan requested a review from KyleFromNVIDIA August 4, 2026 15:27

@KyleFromNVIDIA KyleFromNVIDIA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a few small nitpicks

Comment on lines +344 to +368
jq -n \
--arg artifact_name "${RELEASE_SOURCE_ARTIFACT_NAME}" \
--arg manifest_name "${RELEASE_MANIFEST_NAME}" \
--arg repository "${GITHUB_REPOSITORY:-}" \
--arg run_attempt "${GITHUB_RUN_ATTEMPT:-}" \
--arg run_id "${GITHUB_RUN_ID:-}" \
--arg sha "${source_sha}" \
--arg unit_id "${RELEASE_UNIT}" \
--arg workflow_ref "${GITHUB_WORKFLOW_REF:-}" \
--argjson artifact_metadata "${artifact_metadata}" \
'{
schema_version: 1,
producer: "shared-workflows",
release_unit: $unit_id,
source_artifact: $artifact_name,
build_output_manifest: $manifest_name,
build_environment: {
repository: $repository,
sha: $sha,
workflow_ref: $workflow_ref,
run_id: $run_id,
run_attempt: $run_attempt
},
metadata: {artifacts: $artifact_metadata}
}' | jq -S . >"${metadata_path}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
jq -n \
--arg artifact_name "${RELEASE_SOURCE_ARTIFACT_NAME}" \
--arg manifest_name "${RELEASE_MANIFEST_NAME}" \
--arg repository "${GITHUB_REPOSITORY:-}" \
--arg run_attempt "${GITHUB_RUN_ATTEMPT:-}" \
--arg run_id "${GITHUB_RUN_ID:-}" \
--arg sha "${source_sha}" \
--arg unit_id "${RELEASE_UNIT}" \
--arg workflow_ref "${GITHUB_WORKFLOW_REF:-}" \
--argjson artifact_metadata "${artifact_metadata}" \
'{
schema_version: 1,
producer: "shared-workflows",
release_unit: $unit_id,
source_artifact: $artifact_name,
build_output_manifest: $manifest_name,
build_environment: {
repository: $repository,
sha: $sha,
workflow_ref: $workflow_ref,
run_id: $run_id,
run_attempt: $run_attempt
},
metadata: {artifacts: $artifact_metadata}
}' | jq -S . >"${metadata_path}"
jq -n -S \
--arg artifact_name "${RELEASE_SOURCE_ARTIFACT_NAME}" \
--arg manifest_name "${RELEASE_MANIFEST_NAME}" \
--arg repository "${GITHUB_REPOSITORY:-}" \
--arg run_attempt "${GITHUB_RUN_ATTEMPT:-}" \
--arg run_id "${GITHUB_RUN_ID:-}" \
--arg sha "${source_sha}" \
--arg unit_id "${RELEASE_UNIT}" \
--arg workflow_ref "${GITHUB_WORKFLOW_REF:-}" \
--argjson artifact_metadata "${artifact_metadata}" \
'{
schema_version: 1,
producer: "shared-workflows",
release_unit: $unit_id,
source_artifact: $artifact_name,
build_output_manifest: $manifest_name,
build_environment: {
repository: $repository,
sha: $sha,
workflow_ref: $workflow_ref,
run_id: $run_id,
run_attempt: $run_attempt
},
metadata: {artifacts: $artifact_metadata}
}' >"${metadata_path}"

Comment on lines +238 to +265
jq -n \
--arg artifact_digest "${artifact_digest}" \
--arg artifact_path "${primary_path}" \
--arg repository "${GITHUB_REPOSITORY:-}" \
--arg run_attempt "${GITHUB_RUN_ATTEMPT:-}" \
--arg run_id "${GITHUB_RUN_ID:-}" \
--arg source_sha "${source_sha}" \
--arg workflow_ref "${GITHUB_WORKFLOW_REF:-}" \
--argjson package "${package}" \
'{
_type: "https://in-toto.io/Statement/v1",
subject: [{name: $artifact_path, digest: {sha256: $artifact_digest}}],
predicateType: "https://slsa.dev/provenance/v1",
predicate: {
buildDefinition: {
buildType: "https://rapids.ai/release-platform/build-output/v1",
externalParameters: {release_unit: env.RELEASE_UNIT, package: $package},
resolvedDependencies: [{
uri: ("git+https://github.com/" + $repository + "@" + $source_sha),
digest: {gitCommit: $source_sha}
}]
},
runDetails: {
builder: {id: ("https://github.com/" + $workflow_ref)},
metadata: {invocationId: ("https://github.com/" + $repository + "/actions/runs/" + $run_id + "/attempts/" + $run_attempt)}
}
}
}' | jq -S . >"${output_directory}/${destination}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
jq -n \
--arg artifact_digest "${artifact_digest}" \
--arg artifact_path "${primary_path}" \
--arg repository "${GITHUB_REPOSITORY:-}" \
--arg run_attempt "${GITHUB_RUN_ATTEMPT:-}" \
--arg run_id "${GITHUB_RUN_ID:-}" \
--arg source_sha "${source_sha}" \
--arg workflow_ref "${GITHUB_WORKFLOW_REF:-}" \
--argjson package "${package}" \
'{
_type: "https://in-toto.io/Statement/v1",
subject: [{name: $artifact_path, digest: {sha256: $artifact_digest}}],
predicateType: "https://slsa.dev/provenance/v1",
predicate: {
buildDefinition: {
buildType: "https://rapids.ai/release-platform/build-output/v1",
externalParameters: {release_unit: env.RELEASE_UNIT, package: $package},
resolvedDependencies: [{
uri: ("git+https://github.com/" + $repository + "@" + $source_sha),
digest: {gitCommit: $source_sha}
}]
},
runDetails: {
builder: {id: ("https://github.com/" + $workflow_ref)},
metadata: {invocationId: ("https://github.com/" + $repository + "/actions/runs/" + $run_id + "/attempts/" + $run_attempt)}
}
}
}' | jq -S . >"${output_directory}/${destination}"
jq -n -S \
--arg artifact_digest "${artifact_digest}" \
--arg artifact_path "${primary_path}" \
--arg repository "${GITHUB_REPOSITORY:-}" \
--arg run_attempt "${GITHUB_RUN_ATTEMPT:-}" \
--arg run_id "${GITHUB_RUN_ID:-}" \
--arg source_sha "${source_sha}" \
--arg workflow_ref "${GITHUB_WORKFLOW_REF:-}" \
--argjson package "${package}" \
'{
_type: "https://in-toto.io/Statement/v1",
subject: [{name: $artifact_path, digest: {sha256: $artifact_digest}}],
predicateType: "https://slsa.dev/provenance/v1",
predicate: {
buildDefinition: {
buildType: "https://rapids.ai/release-platform/build-output/v1",
externalParameters: {release_unit: env.RELEASE_UNIT, package: $package},
resolvedDependencies: [{
uri: ("git+https://github.com/" + $repository + "@" + $source_sha),
digest: {gitCommit: $source_sha}
}]
},
runDetails: {
builder: {id: ("https://github.com/" + $workflow_ref)},
metadata: {invocationId: ("https://github.com/" + $repository + "/actions/runs/" + $run_id + "/attempts/" + $run_attempt)}
}
}
}' >"${output_directory}/${destination}"

Comment on lines +199 to +228
jq -n \
--arg artifact_digest "${artifact_digest}" \
--arg artifact_path "${primary_path}" \
--argjson package "${package}" \
'{
spdxVersion: "SPDX-2.3",
dataLicense: "CC0-1.0",
SPDXID: "SPDXRef-DOCUMENT",
name: ("RAPIDS release artifact " + $artifact_path),
documentNamespace: ("https://rapids.ai/release-platform/spdx/" + $artifact_digest),
creationInfo: {
creators: ["Tool: rapidsai/shared-workflows release-build-output"],
created: (now | strftime("%Y-%m-%dT%H:%M:%SZ"))
},
documentDescribes: ["SPDXRef-Artifact"],
packages: [{
SPDXID: "SPDXRef-Artifact",
name: $package.name,
versionInfo: $package.version,
downloadLocation: "NOASSERTION",
filesAnalyzed: false,
checksums: [{algorithm: "SHA256", checksumValue: $artifact_digest}]
}],
relationships: [{
spdxElementId: "SPDXRef-DOCUMENT",
relationshipType: "DESCRIBES",
relatedSpdxElement: "SPDXRef-Artifact"
}],
comment: "Artifact-identity SBOM envelope. A producer-supplied dependency SBOM may replace this record."
}' | jq -S . >"${output_directory}/${destination}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
jq -n \
--arg artifact_digest "${artifact_digest}" \
--arg artifact_path "${primary_path}" \
--argjson package "${package}" \
'{
spdxVersion: "SPDX-2.3",
dataLicense: "CC0-1.0",
SPDXID: "SPDXRef-DOCUMENT",
name: ("RAPIDS release artifact " + $artifact_path),
documentNamespace: ("https://rapids.ai/release-platform/spdx/" + $artifact_digest),
creationInfo: {
creators: ["Tool: rapidsai/shared-workflows release-build-output"],
created: (now | strftime("%Y-%m-%dT%H:%M:%SZ"))
},
documentDescribes: ["SPDXRef-Artifact"],
packages: [{
SPDXID: "SPDXRef-Artifact",
name: $package.name,
versionInfo: $package.version,
downloadLocation: "NOASSERTION",
filesAnalyzed: false,
checksums: [{algorithm: "SHA256", checksumValue: $artifact_digest}]
}],
relationships: [{
spdxElementId: "SPDXRef-DOCUMENT",
relationshipType: "DESCRIBES",
relatedSpdxElement: "SPDXRef-Artifact"
}],
comment: "Artifact-identity SBOM envelope. A producer-supplied dependency SBOM may replace this record."
}' | jq -S . >"${output_directory}/${destination}"
jq -n -S \
--arg artifact_digest "${artifact_digest}" \
--arg artifact_path "${primary_path}" \
--argjson package "${package}" \
'{
spdxVersion: "SPDX-2.3",
dataLicense: "CC0-1.0",
SPDXID: "SPDXRef-DOCUMENT",
name: ("RAPIDS release artifact " + $artifact_path),
documentNamespace: ("https://rapids.ai/release-platform/spdx/" + $artifact_digest),
creationInfo: {
creators: ["Tool: rapidsai/shared-workflows release-build-output"],
created: (now | strftime("%Y-%m-%dT%H:%M:%SZ"))
},
documentDescribes: ["SPDXRef-Artifact"],
packages: [{
SPDXID: "SPDXRef-Artifact",
name: $package.name,
versionInfo: $package.version,
downloadLocation: "NOASSERTION",
filesAnalyzed: false,
checksums: [{algorithm: "SHA256", checksumValue: $artifact_digest}]
}],
relationships: [{
spdxElementId: "SPDXRef-DOCUMENT",
relationshipType: "DESCRIBES",
relatedSpdxElement: "SPDXRef-Artifact"
}],
comment: "Artifact-identity SBOM envelope. A producer-supplied dependency SBOM may replace this record."
}' >"${output_directory}/${destination}"

and ((.build // "") | type == "string")
and ((.platform // "") | type == "string")
' <<<"${RELEASE_PACKAGE}" >/dev/null; then
echo "release-package must be a package object with ecosystem and name; version is optional for Conda and wheel artifacts" >&2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we could ensure version is present for custom artifacts?

Comment on lines +57 to +60
if [[ "${RELEASE_PACKAGE_FILE}" == /* || "${RELEASE_PACKAGE_FILE}" == */../* || "${RELEASE_PACKAGE_FILE}" == ../* || "${RELEASE_PACKAGE_FILE}" == *"/.." ]]; then
echo "release-package-file must be a relative path inside output-directory: ${RELEASE_PACKAGE_FILE}" >&2
exit 1
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can use ensure_relative_pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants