fix(release): share sibling paths through the workspace (#1)
The release job stopped at the bind-source gate. RUNNER_TEMP is container-internal on this runner and no runner mount exposes it on the Docker host, so no sibling container could ever share it; only the workspace is host-mounted. Move every path shared between the runner's shell steps and its sibling containers under $GITHUB_WORKSPACE/.release-work: the release directory, the release builder's HOME and NuGet cache, both candidate image tars, and the container SPDX inventory. Resolution now maps the workspace alone to its host path, and each sibling binds that source at $GITHUB_WORKSPACE and works from there instead of /source, so a shared path is the same string on both sides of the boundary. publish-release.sh follows with a single bind and requires the release directory to sit inside the workspace. Ignore .release-work in Git so the tag gate's cleanliness check stays true while artifacts accumulate, and in Docker so artifacts written between the two candidate builds cannot alter the build context the byte-comparison gate depends on. Skip it in the dependency inventory as well, keeping the restored package cache out of the license policy scan.
This commit is contained in:
@@ -11,11 +11,21 @@ token="${RENDEZVOUS_RELEASE_TOKEN:?RENDEZVOUS_RELEASE_TOKEN is required}"
|
||||
username="${RENDEZVOUS_RELEASE_USERNAME:?RENDEZVOUS_RELEASE_USERNAME is required}"
|
||||
release_builder="${RENDEZVOUS_RELEASE_BUILDER:?RENDEZVOUS_RELEASE_BUILDER is required}"
|
||||
# Sibling-container runners execute this script inside a container while
|
||||
# `docker run` starts containers on the host daemon, so bind sources must be
|
||||
# host paths. The workflow resolves them once and exports them; a direct host
|
||||
# run keeps the local paths.
|
||||
# `docker run` starts containers on the host daemon, so the bind source must be
|
||||
# a host path. The workflow resolves the workspace once and exports it; a direct
|
||||
# host run keeps the local path. Only the workspace is bound, so the release
|
||||
# directory has to live inside it, and binding it back onto its own path keeps
|
||||
# every shared path identical on both sides of the boundary.
|
||||
workspace_source="${RENDEZVOUS_WORKSPACE_SOURCE:-$root}"
|
||||
release_dir_source="${RENDEZVOUS_RELEASE_DIR_SOURCE:-$release_dir}"
|
||||
[[ -d "$release_dir" ]] || {
|
||||
echo "Release directory does not exist: $release_dir" >&2
|
||||
exit 1
|
||||
}
|
||||
release_dir="$(cd "$release_dir" && pwd)"
|
||||
if [[ "$release_dir" != "$root"/* ]]; then
|
||||
echo "Release directory must live inside the workspace: $release_dir" >&2
|
||||
exit 1
|
||||
fi
|
||||
docker_config="$(mktemp -d)"
|
||||
curl_config="$(mktemp)"
|
||||
release_request=""
|
||||
@@ -52,9 +62,8 @@ cosign public-key --key env://COSIGN_PRIVATE_KEY >/dev/null || {
|
||||
run_release_builder() {
|
||||
docker run --rm \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
--volume "$workspace_source:/source:ro" \
|
||||
--volume "$release_dir_source:$release_dir" \
|
||||
--workdir /source \
|
||||
--volume "$workspace_source:$root" \
|
||||
--workdir "$root" \
|
||||
"$release_builder" "$@"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user